Solved

AutoPostBack through Javascript - GetPostBackClientEvent

Posted on 2004-03-21
11
4,681 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
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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 250 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 250 total points
ID: 10654028
if you set your TextBox's AutoPostBack = true, then try to use __doPostBack('YourTextBox','')

locitt.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

778 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