Solved

Load script after  geting values of database....in asp.net

Posted on 2014-04-10
12
432 Views
Last Modified: 2014-05-18
Hello,
I am working on travel site.
In my webpage there is an booking engine which is called by following javascript..


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
        <script language="javascript" id="OFrameworkJS" ThemeURI="SideSE/" SkinID="default" src="https://bookings.abc.com/web/SearchForms/OFramework.js"></script>
<script language=javascript type="text/javascript">
    
    OFramework.QSParams.Add("siid", "1234")
    oAForm = OFramework.AirSearchForm(document.getElementById("AirSearchForm"));
</script>

Open in new window



And this script targets an unique id on page like this

<span id="AirSearchForm"></span>

Open in new window


So when we execute this page on browser then the search engine is active like below screen
Booking engine called with Jscript
NOW,
The problem is,
Now I am updating the code, I want the value of siid is to be placed from database in the javascript code (in this case "1234"- This value should come from DB)
OFramework.QSParams.Add("siid", "1234")

But when I am getting value of siid from DB and assign to the hidden field and then  access it in javascript....  is not working...
I have tried this on PageLoad event.
Even I have tried PagePreInit method, but in this method I am not getting the HiddenField Control...
So Can anybody help me on this....???
How to assign the values from DB before executing javascript
0
Comment
Question by:Manoj Patil
  • 5
  • 5
12 Comments
 
LVL 7

Expert Comment

by:Utkarsh Kulkarni
ID: 40027206
Hi,
Do you mean that you set value from DB to hidden field on Page load event & you are not getting that value in Java Script ?
0
 
LVL 19

Author Comment

by:Manoj Patil
ID: 40028384
Yes, I want to do the same... But I am getting the value...in javascript
But the issue is...
That javascript is calling an Booking engine from another server having unique customer ID...And I am storing that Customer ID in Database. So I want it to be receive and load before booking engine is called....
0
 
LVL 7

Expert Comment

by:Utkarsh Kulkarni
ID: 40028849
You can use jQuery for the same. Even using simple java script you delay the booking engine call / loading (using timer).
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 19

Author Comment

by:Manoj Patil
ID: 40030486
Can you give me the example.. for this ??
0
 
LVL 19

Author Comment

by:Manoj Patil
ID: 40049977
I've requested that this question be deleted for the following reason:

No Solutions
0
 
LVL 7

Accepted Solution

by:
Utkarsh Kulkarni earned 500 total points
ID: 40049970
I am sorry for delay
Here is the link that explains how to add delay....
You can increase the delay value to 3 seconds, before loading the external URL

http://stackoverflow.com/questions/1183872/put-a-delay-in-javascript

If this does not solves your issue, then you can delete this question.

Thanks
0
 
LVL 7

Expert Comment

by:Utkarsh Kulkarni
ID: 40049978
Check the suggested solution before deleting.
0
 
LVL 19

Author Comment

by:Manoj Patil
ID: 40050117
OK. Thanks
Will check and tell you
0
 
LVL 7

Expert Comment

by:Utkarsh Kulkarni
ID: 40061429
Hi techChallenger1

Did you get chance to check this?
0
 
LVL 19

Author Closing Comment

by:Manoj Patil
ID: 40073626
Hey,
Thanks for your solution.
It's working !!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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
HTML Anchor Link Problem 3 37
on window close, not beforeunload 6 18
How to control cache of some js files ? 7 41
dynamic created check uncheck boxes 6 23
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

827 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