Solved

AutoPostBack through Javascript - GetPostBackClientEvent

Posted on 2004-03-21
11
4,664 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
11 Comments
 
LVL 28

Expert Comment

by:mmarinov
Comment Utility
have you tried this

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

B..G
0
 

Author Comment

by:rajayaseelan
Comment Utility
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
Comment Utility
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
 

Author Comment

by:rajayaseelan
Comment Utility
did you show any sample (bcos- i am not that much familier with IPostBackDataHandler)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Expert Comment

by:pratap_surisoft
Comment Utility
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
Comment Utility
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
Comment Utility
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 250 total points
Comment Utility
Have you tried using a zero-sized IFrame to handle the postback + data fill?
0
 
LVL 4

Assisted Solution

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

locitt.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now