Solved

AutoPostBack through Javascript - GetPostBackClientEvent

Posted on 2004-03-21
11
4,696 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why use this lambda? 12 95
VB.Net SQL Query 2 Tables Different Databases 3 61
Asp.Net Session Question 2 47
PowerShell: ForEach-Object Export to CSV 4 91
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

732 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