Re: Parsen von Clientside Qnderung?= durch Serverside

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Olaf Lüder [MVP] (olnews_at_nogetec.de)
Date: 03/26/05


Date: Sat, 26 Mar 2005 15:49:46 +0100

Hallo Mike,

"Mike Podonyi" <mp20@gmx.de> schrieb:

> Mir stellt sich momentan die Frage wie intelligent sind die Serverseitigen
> Controls.
> Ich habe 3 DIV´s (HtmlGenericControl also serverseitig), und 3
> Optionsschaltflachen (ausschließlich Clientcode).
> Beim Click auf die Optionsschaltflächen wird JavaScript ausgeführt und es
> wird jeweils eines von den DIV´s sichtbar gemacht (visible)
> beziehungsweise die anderen nicht sichtbar. Das alles geschieht
> ausschließlich Clientseitig.
>
> Werden jetzt nach dem Postback zum Server die visible Attribute für die
> HtmlControls (Serverseitig) aktualisiert oder muß man das selbst erledigen
> (verstecktes feld setzen und serverseitig auslesen). Wenn ja, wird das
> dann auch bei den Webcontrols so gemacht.

nein, das musst Du manuell machen. Serverseitig erhältst Du über die
clientseitig vorgenommene Änderungen keinerlei Informationen. Der Server
erhält (abgesehen vom Querystring und Cookies) nur die geposteten Daten,
also die sichtbaren und versteckten Formularfelder.

Du hast also gar keine große Wahl (sofern Dein Clientscript nicht einen
sofortigenb Postback auslöst) und es wird in der Praxis tatsächlich über
RegisterClientScriptBlock & RegisterHiddenField samt entsprechender
Auswertung beim Postback erledigt.

-- 
Gruß, Olaf
MS MVP ASP / ASP.NET


Relevant Pages

  • Re: Event Handler doesnt fire immediately upon postback?
    ... make its comparisons and work with the PostBack event handlers. ... It seems like such a waste of resources to me sometimes to use controls like ... I still prefer to do as much client-side processing as possible ... the event handler fires immediately. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Event Handler doesnt fire immediately upon postback?
    ... ASP.Net programming model, coming from Classic ASP, which is entirely ... Controls within Controls in the Page, which is, itself, a Control. ... previous state (prior to the PostBack), and only then does the Page (and ... the event handler fires immediately. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET with Datasets
    ... the postbacked viewstate is used to re-create the ... controls are recreated. ... Before or after that you bind the datagrid, you set the dataset in the ... At a postback, you set the session.item back in the dataset, which you (to ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: viewstate = false doesnt work
    ... The viewstate was created to store other ... So IMO your controls are just reinitialized from postback values. ... checkboxs showing their skills. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem with EventHandlers
    ... Do you know of a way to check which button caused the page load? ... "All controls should be created and added to their parent's Controls ... "If the current request is a postback, the postback data has not yet ... before calling the button's EventHandler. ...
    (microsoft.public.dotnet.languages.csharp)