Re: textbox value lost upon postback

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ashish (nomail_at_myself.com)
Date: 02/17/04


Date: Tue, 17 Feb 2004 12:55:37 -0500

I tried javascript postback while using server button and it doesnt work. I
tried modalless window.open mechanism with server control again it doesnt
work. Can u gimme an example of how u do it ?
Thanks
Ashish

"James Culshaw" <JamesC@dumgal.gov.uk> wrote in message
news:0FBD9D3F-3715-41C0-BEC9-4AE88DB1B383@microsoft.com...
> The problem is the serverside button. It automatically starts a postback
when you click it. You can change the value of the control on the
client-side via JavaScript and then submit the form and pick up the new
value on the server, its something I do all the time. If you show the form
modally ther is a problem that when the page that is the modal popup page is
submitted it actually submits the parent window rather than the current
window. This might also be causing the problem. To open the popup windiw try
using a standard html button rather than a webforms button. Also, try not
opening the new window modally and see if that helps.
>
> James :-)
>
> ----- Ashish wrote: -----
>
> Hi All,
> I have a server runnable textbox control. I also have a server side
button
> object but I hook up javascript to it to show a modal dialog. Upon
return it
> places the value in the textbox (client side script). The problem is
that
> after it places the value, postback occurs and value is lost. I have
tried
> overriding SaveViewState and LoadViewState but it doesnt help (for
some
> super cool reason load is called first after postback rather than
save view
> state. however since the value of textbox is changed on client side
it
> doesnt help at all). Next I tried implementing IPostBackDataHandler
and
> IPostBackEventHandler events but the methods arent' called at all.
Help !!!
> I wanna prevent silly workouts of a hidden field if possible.
> Thanks
> Ashish
>
>
>



Relevant Pages

  • Re: Hidden Text Field Occasionally Missing Data on Postback
    ... by the ISP that were issued after the 1.1. ... 'Lets PreRender know that a control event caused postback ... for repositioning logic executed on the server postback. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: textbox value lost upon postback
    ... I tried javascript postback while using server button and it doesnt work. ... You can change the value of the control on the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: What causes a server event to fire due to a change on the client?
    ... the communication betweoen the client and server are html form fields. ... when you write a server control your control responds to two events generated by the frame work. ... LoadPostData - your control called and passed all the form postback values, and your data key. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Understanding query strings
    ... different control is assigned to the same ID after postback. ... I navigate to the page using a querystring (which then selects the ... > | gridview that shows details about that server. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: DropDownBox value after postback differs...
    ... server, so the server can not know the new value. ... the viewstate has the value at render and can not be ... the viewstate value is compared the postback value ... the disabled control, and copy the value. ...
    (microsoft.public.dotnet.framework.aspnet)