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
Solved

AutoPostBack through Javascript - GetPostBackClientEvent

Posted on 2004-03-21
11
4,686 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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 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.

839 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