Showing posts with label pages. Show all posts
Showing posts with label pages. Show all posts

Monday, March 26, 2012

Must have a <head runat="server"> Error

When i use<atlas:ScriptManager> tag in .aspx or .ascx pages without <head runat =server> , i get the following error. Is this a bug or as designed?

Server Error in '/AtlasWebSite' Application.

Must have a <head runat="server">

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.InvalidOperationException: Must have a <head runat="server"
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[InvalidOperationException: Must have a <head runat="server">] Microsoft.Web.UI.ScriptManager.OnPreRender(EventArgs e) +262 System.Web.UI.Control.PreRenderRecursiveInternal() +77 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

As designed, you need that runat attribute.
I got this too (which is easily fixed by making the head runat="server") but is this a requirement on any page using Atlas?

LordHits wrote:

but is this a requirement on any page using Atlas?

Hi,

no it isn't. If you're using Themes in ASP.NET 2.0 it's required to have that attribute.

Grz, Kris.


But i am not using any themes in my website which is fairly simple ASP.NET 2.0 impelementation. Infact i am using Atlas in .ascx control and .ascx control is loaded first then the page, as a result scripmanager is unable to see the <head runat=server> tag and generates this error.

Any clue?


XIII wrote:

Hi,

no it isn't. If you're using Themes in ASP.NET 2.0 it's required to have that attribute.

Grz, Kris.

Ok, but i'm not using themes and I still go that message. I don't know if it matters, but my scriptmanager control resides in a content page as opposed to the master page.


Hi,

I had the same problem. An .aspx page with a placeholder, loading an ascx control in code behind.

I replace the <head> section in my aspx page with<headid="headSection"runat="server">, and now it works.

As the ascx control had an updatepanel, i had to do the loadcontrol in the page-init method.

Hope that will solve your pb.

Gilles


hello guys.

i believe that the head element must be a server element since it's one of the sections that is sent back from the server to the client during a partial postback (ie, it's contents are parsed and send on every partial postback response).


Hi,

If you are using Master pages.. then have to make sure that <head runat="server"> is there in the master page.

regards,

ukv

My .aspx lost his format when I change a property on design mode

Hello,

I've just updated my project to the new ajax beta 1.

Everything looks fine, but when I make some change on my pages in design mode, the aspx source code lost completly the previous format.

Somebody could help me.

Thanks,

Rodrigo Sendin

Hello Ajax Guys,

I think my problem is related with an issue posted by "tschlarm" today (Beta 1 issues). I am working with Master Pages and I used to work in Design mode. After beta 1 I am having problems with the format of the aspx source code. (the source code format is totally changed when I work in Design)

I´ve modifed my web.config in order to change the tagPrefix of ajax controls (from asp to ajax), and the problem has stoped. My web.config was changed to:

<addtagPrefix="ajax"namespace="Microsoft.Web.UI"assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagPrefix="ajax"namespace="Microsoft.Web.UI.Controls"assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagPrefix="ajax"namespace="Microsoft.Web.Preview.UI"assembly="Microsoft.Web.Preview"/>

<addtagPrefix="ajax"namespace="Microsoft.Web.Preview.UI.Controls"assembly="Microsoft.Web.Preview"/>

Thanks,
Rodrigo Sendin

Saturday, March 24, 2012

my page is slower with ajax than without it. Help!

Hi,

I am using ajax extensions 1.0 and ajaxcontroltoolkit in my web pages. I only use the calendarextender and the tabcontainer of the toolkit.

On the other hand I use an updatepanel that contains my controls and grid in the page.

When I test the web page with ajax, it is slower than when I test it without the scriptmanager and updatepanel, etc.

I have in the web config:

<compilationdebug="false">

<scriptResourceHandlerenableCompression="true"enableCaching="true"/>

Is it common that ajax is slower than the normal page?

What can I do to make ajax faster?

thanks in advance,

Daniel.

Take a look at this post:http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

That's not to say you should never use an UpdatePanel, but you need to understand how it works and use it appropriately. Without knowing more about your particular page's design, it's hard to give more specific advice.


Ok, thank you for the information.

I have a question:

Is it bad to have only one updatepanel that surrounds all the controls in the web page? or it is better to have several updatepanels in the web page?

Is not there any other way to put faster the perfomance in ajax to have it the same speed that the web page without ajax?

thanks a lot,

Daniel.


If your page has more than just a few controls on it, I would definitely recommend using multiple UpdatePanels. You can't avoid the ViewState and page reinstantiation, but you can at least cut down on how much HTML is returned and how much work the PageRequestManager has to put into parsing and updating that content. Make sure to use an UpdateMode of Conditional when working with multiple UpdatePanels.

If you want faster performance, try to use web methods or page methods as I describe in my post. When using light weight mechanisms like that, you can both achieve huge performance gains and reduce server load.


Hi,

I am still having the problem: my page is slower with ajax, than without it.

I have an updatepanel for the page. I tried to put the updatepanel only for the gridview but everything was the same, so I think my problem is not that I'm using only one updatepanel for the whole page.

Can you see my code below and help me, please?

I have several panels, objectdatasource, one gridview, code in HTML.

thanks a lot,

Daniel.

<%@.PageLanguage="C#"MasterPageFile="~/_plantillas/plantillamain.master"AutoEventWireup="true"CodeFile="clientesabc.aspx.cs"Inherits="clientes_clientesabc"Title="Untitled Page" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">

<asp:ScriptManagerID="ScriptManager1"runat="server">

</asp:ScriptManager>

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="conditional">

<ContentTemplate>

<asp:PanelID="pnlExterior"runat="server"Width="100%">

HTML

<asp:PanelID="pnlDatos"runat="server"Width="100%"Visible="false">

HTML

</asp:Panel>

<asp:PanelID="pnlResumenVentasCompras"runat="server"Width="100%"Visible="false">

HTML

</asp:Panel>

<asp:LabelID="lblTituloGrid"runat="server"CssClass="LabelRealizado"></asp:Label>

<asp:LinkButtonID="lbtQuitarFiltro"runat="server"OnClick="lbtQuitarFiltro_Click"CausesValidation="False">Quitar Filtro</asp:LinkButton><br/>

<asp:GridViewID="gvw1"runat="server"Width="100%"AllowPaging="True"AllowSorting="True"AutoGenerateColumns="False"DataKeyNames="intIDCodigoCliente_fl"DataSourceID="odsClientes"GridLines="Horizontal"CaptionAlign="Left"CssClass="CeldaFondoMasClara"BorderColor="Silver"BorderWidth="1px"OnPageIndexChanged="gvw1_PageIndexChanged"OnPageIndexChanging="gvw1_PageIndexChanging"OnRowDataBound="gvw1_RowDataBound"OnSelectedIndexChanged="gvw1_SelectedIndexChanged"OnSorted="gvw1_Sorted"OnSorting="gvw1_Sorting"PageSize="20">

<Columns>

<asp:TemplateFieldShowHeader="False">

<ItemTemplate>

<asp:ImageButtonID="ibtEliminar"runat="server"CausesValidation="false"CommandName="Delete"ImageUrl="~/_archivos/iconos/gridEliminar.gif"ToolTip="Eliminar"BorderWidth="0"ImageAlign="AbsMiddle"/>

</ItemTemplate>

<ItemStyleWidth="20px"/>

</asp:TemplateField>

<asp:CommandFieldButtonType="Image"ShowSelectButton="True"SelectImageUrl="~/_archivos/iconos/gridSeleccionar.gif"SelectText="Seleccionar">

<ItemStyleWidth="20px"/>

</asp:CommandField>

<asp:TemplateFieldHeaderText="# Cliente"SortExpression="intIDCodigoCliente_fl">

<ItemTemplate>

<asp:LabelID="lblNumeroCliente"runat="server"Text='<%# Bind("intIDCodigoCliente_fl") %>'></asp:Label>

</ItemTemplate>

<ControlStyleCssClass="TextBoxNormal"/>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Sucursal"SortExpression="vchNombreSucursal_fl">

<ItemTemplate>

<asp:LabelID="lblSucursal"runat="server"Text='<%# Bind("vchNombreSucursal_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Razón Social"SortExpression="vchRazonSocial_fl">

<ItemTemplate>

<asp:LabelID="lblRazonSocial"runat="server"Text='<%# Bind("vchRazonSocial_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="RFC"SortExpression="vchRFC_fl">

<ItemTemplate>

<asp:LabelID="lblRFC"runat="server"Text='<%# Bind("vchRFC_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Contacto">

<ItemTemplate>

<spanclass="LabelSubrayado">Telef</span>:<asp:LabelID="lblTelefono1"runat="server"Text='<%# Bind("vchTelefono1_fl") %>'></asp:Label> ,<asp:LabelID="lblTelefono2"runat="server"Text='<%# Eval("vchTelefono2_fl") %>'></asp:Label><br/>

<spanclass="LabelSubrayado">Email</span>:<asp:HyperLinkID="hlkEmail"Text='<%# Bind("vchEmail_fl") %>'NavigateUrl='<%# Correo(Eval("vchEmail_fl")) %>'CssClass="EnlaceSinNegrita"runat="server"></asp:HyperLink><br/>

<spanclass="LabelSubrayado">Contacto</span>:<asp:LabelID="lblContacto"runat="server"Text='<%# Bind("vchContacto_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Persona">

<ItemTemplate>

<asp:LabelID="lblPersona"runat="server"Text='<%# TipoPersona(Eval("bitPersonaFisica_fl"))%>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderImageUrl="~/_archivos/iconos/gridusuarioActivar.gif"HeaderText="Activo">

<ItemTemplate>

<asp:CheckBoxID="ckbActivo"runat="server"Checked='<%# ValorBoolean(Eval("IsApproved")) %>'Enabled="false"/>

</ItemTemplate>

<HeaderStyleHorizontalAlign="Center"/>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Tipo de Venta">

<ItemTemplate>

<asp:LabelID="lblTipoVenta"runat="server"Text='<%# Bind("ClienteEstatusVenta")%>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldShowHeader="False"HeaderText="CAMPOS OCULTOS">

<ItemTemplate>

<asp:LabelID="lblNombreCliente"runat="server"Text='<%# Bind("vchNombreCliente_fl") %>'></asp:Label>

<asp:LabelID="lblCalle"runat="server"Text='<%# Bind("vchCalle_fl") %>'></asp:Label>

<asp:LabelID="lblNumExterior"runat="server"Text='<%# Bind("vchNumeroExterior_fl") %>'></asp:Label>

<asp:LabelID="lblNumInterior"runat="server"Text='<%# Bind("vchNumeroInterior_fl") %>'></asp:Label>

<asp:LabelID="lblEntreCalle1"runat="server"Text='<%# Bind("vchEntreCalle1_fl") %>'></asp:Label>

<asp:LabelID="lblEntreCalle2"runat="server"Text='<%# Bind("vchEntreCalle2_fl") %>'></asp:Label>

<asp:LabelID="lblColonia"runat="server"Text='<%# Bind("vchColonia_fl") %>'></asp:Label>

<asp:LabelID="lblEstado"runat="server"Text='<%# Bind("Estado") %>'></asp:Label>

<asp:LabelID="lblMunicipio"runat="server"Text='<%# Bind("Municipio") %>'></asp:Label>

<asp:LabelID="lblPoblacion"runat="server"Text='<%# Bind("vchPoblacion_fl") %>'></asp:Label>

<asp:LabelID="lblFax"runat="server"Text='<%# Bind("vchFax_fl") %>'></asp:Label>

<asp:LabelID="lblCP"runat="server"Text='<%# Bind("vchCodigoPostal_fl") %>'></asp:Label>

<asp:LabelID="lblPrecioLista"runat="server"Text='<%# Bind("sinPrecioListaFacturar_fl") %>'></asp:Label>

<asp:LabelID="lblDescuento"runat="server"Text='<%# Bind("monDescuento_fl") %>'></asp:Label>

<asp:LabelID="lblDiasPlazo"runat="server"Text='<%# Bind("sinDiasPlazoPago_fl") %>'></asp:Label>

<asp:LabelID="lblDescuentoProntoPago"runat="server"Text='<%# Bind("monDescuentoProntoPago_fl") %>'></asp:Label>

<asp:LabelID="lblComision"runat="server"Text='<%# Bind("monComisionVenta_fl") %>'></asp:Label>

<asp:LabelID="lblLimiteCredito"runat="server"Text='<%# Bind("monLimiteCredito_fl") %>'></asp:Label>

<asp:LabelID="lblIDClienteEstatusVenta"runat="server"Text='<%# Bind("sinIDClienteEstatusVenta_fl") %>'></asp:Label>

<asp:LabelID="lblIDClienteMedioEmbarque"runat="server"Text='<%# Bind("sinIDClienteMedioEmbarque_fl") %>'></asp:Label>

<asp:LabelID="lblUserId"runat="server"Text='<%# Bind("UserId") %>'></asp:Label>

<asp:CheckBoxID="ckbCambiaPassword"runat="server"Checked='<%# ValorBoolean(Eval("bitCambiaPassword_fl")) %>'/>

<asp:CheckBoxID="ckbRevLu"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionLunes_fl")) %>'/>

<asp:CheckBoxID="ckbRevMa"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionMartes_fl")) %>'/>

<asp:CheckBoxID="ckbRevMi"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionMiercoles_fl")) %>'/>

<asp:CheckBoxID="ckbRevJu"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionJueves_fl")) %>'/>

<asp:CheckBoxID="ckbRevVi"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionViernes_fl")) %>'/>

<asp:CheckBoxID="ckbRevSa"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionSabado_fl")) %>'/>

<asp:CheckBoxID="ckbPagLu"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoLunes_fl")) %>'/>

<asp:CheckBoxID="ckbPagMa"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoMartes_fl")) %>'/>

<asp:CheckBoxID="ckbPagMi"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoMiercoles_fl")) %>'/>

<asp:CheckBoxID="ckbPagJu"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoJueves_fl")) %>'/>

<asp:CheckBoxID="ckbPagVi"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoViernes_fl")) %>'/>

<asp:CheckBoxID="ckbPagSa"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoSabado_fl")) %>'/>

<asp:LabelID="lblmonVenta01"runat="server"Text='<%# Bind("monVenta01_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta02"runat="server"Text='<%# Bind("monVenta02_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta03"runat="server"Text='<%# Bind("monVenta03_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta04"runat="server"Text='<%# Bind("monVenta04_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta05"runat="server"Text='<%# Bind("monVenta05_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta06"runat="server"Text='<%# Bind("monVenta06_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta07"runat="server"Text='<%# Bind("monVenta07_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta08"runat="server"Text='<%# Bind("monVenta08_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta09"runat="server"Text='<%# Bind("monVenta09_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta10"runat="server"Text='<%# Bind("monVenta10_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta11"runat="server"Text='<%# Bind("monVenta11_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta12"runat="server"Text='<%# Bind("monVenta12_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado01"runat="server"Text='<%# Bind("monPagado01_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado02"runat="server"Text='<%# Bind("monPagado02_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado03"runat="server"Text='<%# Bind("monPagado03_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado04"runat="server"Text='<%# Bind("monPagado04_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado05"runat="server"Text='<%# Bind("monPagado05_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado06"runat="server"Text='<%# Bind("monPagado06_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado07"runat="server"Text='<%# Bind("monPagado07_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado08"runat="server"Text='<%# Bind("monPagado08_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado09"runat="server"Text='<%# Bind("monPagado09_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado10"runat="server"Text='<%# Bind("monPagado10_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado11"runat="server"Text='<%# Bind("monPagado11_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado12"runat="server"Text='<%# Bind("monPagado12_fl") %>'></asp:Label>

</ItemTemplate>

<ControlStyleCssClass="oculto"/>

<ItemStyleCssClass="oculto"/>

<HeaderStyleCssClass="oculto"/>

<FooterStyleCssClass="oculto"/>

</asp:TemplateField>

</Columns>

<SelectedRowStyleCssClass="CeldaFilaBrillante"/>

<PagerSettingsMode="NumericFirstLast"/>

<PagerStyleCssClass="GridPaging"/>

<HeaderStyleHorizontalAlign="Left"CssClass="CeldaFondoClara"/>

</asp:GridView>

8 ObjectDataSource

</asp:Panel>

</ContentTemplate>

</asp:UpdatePanel>

</asp:Content>


have you tried to evaluate why the page is slow by using fiddler? This could give you an indication of where the slow down is occuring and also ensure that everything is being cached where it can be.

Also, if you have a large viewstate, you may want to look at overriding the PageStatePersister property and save your viewstate to session using theSessionPageStatePersister object.

Navigation between pages without refreshing entire page.

Hi

How can i do page navigation without out getting any refresh on web page, LikeNikhil Kothari's Weblog www.nikhilk.net/ .

is there any atlas control to do that ? or How is it possible to enable this ?

Regards,

Gopinath, gopinathnet@dotnet.itags.org.gmail.com

That's not AJAX. It's just a fancy way of transitioning a page. You can google for "web page transition" or check out the following page for some samples:

http://www.hypergurl.com/transition.html

Navigation using Master pages and Update panel without refresh

Hi

I have a master page in which there are hyperlinks to go to different pages. Its a header basically. I got the relevant content pages for the hyperlinks.

But when I click the master page links, a postback occurs and the whole page is refreshed and directed to the new page.

I need a way by which when I click the hyperlinks in master page the content pages change without any refreshing. I heard about the Iframe implementaion in update panel is it a feasible way to do this or multiview might solve my problem ?

Having a master page sort of defeats the purpose of keeping the same page and dynamically updating portions on postback. The master page is meant to be a supplement for the page the user is viewing. This means the master page is never browsed directly, it only contains master code for each of the pages that are browsed to directly.

Also, hyperlink controls should not perform postbacks -- they are simply meant for navigation. Therefore, anytime a user clicks a hyperlink, the user will be taken to the new page, causing flicker. I suggest using a link button instead. These perform postbacks and can capture events much better than a hyperlink.

In order to do what you're trying to do, consider not using a master page. Instead, use a single page that makes use of either an iframe or a multiview enclosed in an updatepanel. Example is below:

<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Untitled Page</title>
</head>
<body>
<formid="theForm"runat="server">
<divid="wrapper">
<asp:ScriptManagerID="scriptManager"runat="server"></asp:ScriptManager>
<divid="header">
<asp:LinkButtonID="lnkClickMe"runat="server"OnClick="lnkClickMe_Click">Click Me!</asp:LinkButton>
</div>
<asp:UpdatePanelID="pnlDynamicContent"runat="server"UpdateMode="Conditional">
<ContentTemplate>
<asp:MultiViewID="mvDynamicContent"runat="server"ActiveViewIndex="0">
<asp:ViewID="viewBeforeClick"runat="server">
This is before the link above is clicked
</asp:View>
<asp:ViewID="viewAfterClick"runat="server">
This is after the link above is clicked
</asp:View>
</asp:MultiView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="lnkClickMe"EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

And the code-behind:

PartialClass Test_ForumTest
Inherits System.Web.UI.Page

ProtectedSub lnkClickMe_Click(ByVal senderAsObject,ByVal eAs EventArgs)
mvDynamicContent.ActiveViewIndex = 1
EndSub
EndClass


Convert your hyperlink to linkbuttons then register these buttons as AsyncTrigger in the Update Panel. Convert Your Content Pages to User Control. Load the Proper User Control on Button Click.

Wednesday, March 21, 2012

need help in master pages using ajax

hi all i need an advice concerning the use of master page using async

first ive discovered that page loads using links to pages of the same master page cant be done without postback so am searching for a way to apply a way of implementing my site using master pages and ajax

so i put a master page with a header and a contant place holder next i implemented a page using mymaster page and i put within a iframe for the other pages so as those pages can be loaded asyc for the first time it seemd working just fine but when i put in the pages residing in the iframe an ajax implementation it asks for script manager so heres the prob

plz give me a good way implementing my master page without many postbacks and without using multiview

a conceptual way ........ thanks a lot

Why use masterpages if you want your pages to behave like you are using frames? You would probably be better off if you just had an aspx page with an iFrame.

Need more info than args.get_postBackElement().id

The gridview has Edit option on each row and pages at the bottom for paging.

For paging, I just refresh the current gridview (UpdatePanel) with content of the next page.

For edit, I need to load the content of a row into a separate UpdatePanel.

The mouseover of edit & paging show the same elements

__doPostBack('ctl00$ContentPlaceHolder1$grdEvents','LoadEdit$0')

__doPostBack('ctl00$ContentPlaceHolder1$grdEvents','Page$0')

I need to be able to access the variable that contains the second parameter LoadEdit$0/Page$0 to distinguish which action and turn on the coressponding indicator.

Hi,

<inputtype="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /><input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />function __doPostBack(eventTarget, eventArgument) {if (!theForm.onsubmit || (theForm.onsubmit() != false)) {theForm.__EVENTTARGET.value = eventTarget;theForm.__EVENTARGUMENT.value = eventArgument;theForm.submit();}}

Analysis

The __doPostBack function takes two arguments, eventTarget and eventArgument. The eventTarget contains the ID of the control that causes the postback and the eventArgument contains any additional data associated with the control. Note that the two hidden fields, "__EVENTTARGET" and "__EVENTARGUMENT," are automatically declared. The value of the eventTarget and eventArgument are stored in the hidden fields. The two hidden variables can be accessed from the code behind using the forms/params collection.

Using the hidden variables you can also find the ID of the control which causes the postback. All you need to do is to retrieve the value of the __EVENTTARGET from the form parameter collection. Take a look at the code below.

Listing 2 – Getting the _EVENTTARGET hidden field

protected void Page_Load(object sender, EventArgs e){  string controlName = Request.Params.Get("__EVENTTARGET");}
The same to eventArgument!
Best Regards,