[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

AutoPostBack through Javascript - GetPostBackClientEvent

Posted on 2004-03-21
11
Medium Priority
?
4,722 Views
Last Modified: 2007-12-19
Hi,

   I am creating a Server control (Lookup - like datepicker)
   I have 1 Textbox and 1 Image Button, when i am clicking that image
button, it shows lookup and it contains number of records, when i am
selecting a record that value is filled in my text box...

   My requirement is after filling that value in my text box i want
raise post back...(ie. i want to retreive more information based on
selected value...In server side, after entering value in my text box
when i press tab the event "OnTextChanged" getting fired - i am getting
it,s working fine) - i tried GetPostBackClientEvent - but i didn't
get result working

How can i achieve this? Is there any solution???

JC
0
Comment
Question by:rajayaseelan
9 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 10647162
have you tried this

<script language="JavaScript">
 document.forms[0].submit();
</script>

B..G
0
 

Author Comment

by:rajayaseelan
ID: 10647195
Hi,

   I am not submitting the values, say for e.g I have an ID field after entering ID, i want to Load Name which is related to Entered ID... when i tab, OnTextChanged Event getting fired (like wise) I am selecting ID value from my lookup.. i assign a value to the textbox based on lookup selection... that time it should fire same like OnTextChanged Event...
0
 

Expert Comment

by:pratap_surisoft
ID: 10647221
When the type attribute is "submit", the name (UniqueID) is posted by
the browser. On the server, the page then uses the UniqueID to find your control and invoke its RaisePostBackEvent method.


Implement IPostBackDataHandler to recover the coordinates from the
NameValueCollection. In addition, invoke Page.RegisterRequiresPostBack(this) in PreRender so that LoadPostData is invoked by the page. Also, from LoadPostData invoke Page.RegisterRequiresRaiseEvent(this) to make sure that RaisePostBackEvent gets called.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:rajayaseelan
ID: 10647235
did you show any sample (bcos- i am not that much familier with IPostBackDataHandler)
0
 

Expert Comment

by:pratap_surisoft
ID: 10647241
well, please gothru this article and gothru MSDN for IPostBackDataHandler you will get perfect info and samples from MSDN online.
meantime just have a look at this link and iam sure this will helps u to create Dynamic Controls and this article shows the example of your choice.

http://www.kbalertz.com/Feedback_317515.aspx

Getback to me if u didnt find the answer on this

0
 

Expert Comment

by:pratap_surisoft
ID: 10647246
Microsoft also providing the same info abt this, have a look http://support.microsoft.com/default.aspx?scid=kb;EN-US;317515

Pratap
0
 

Author Comment

by:rajayaseelan
ID: 10647268
Boss..

    In these examples, event get fired when lost focus the control, but i need the same to be implemented through javascript ( when i am filling some information in client side,  it should autopostback and it should fire and event)
0
 
LVL 4

Accepted Solution

by:
Nazdor earned 1000 total points
ID: 10647716
Have you tried using a zero-sized IFrame to handle the postback + data fill?
0
 
LVL 4

Assisted Solution

by:locitt
locitt earned 1000 total points
ID: 10654028
if you set your TextBox's AutoPostBack = true, then try to use __doPostBack('YourTextBox','')

locitt.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question