Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Open Points: 75 Time: 21:00 - Aug 27, 2007  

Devan Madhusudanv

Page_load Event in Web Application

Hi

If I have webpage named it CUST.ASPX being accessed by two events from SEARCH.ASPX, how CUST.ASPX be able to direct to the correct process in their page_load event:

CUST.ASPX

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
UnlockTextBoxes()
If Not IsPostBack Then
If blntrigger(Session("trigger") = ddlAProc.SelectedItem) Then
InitializeForm()
strSQL = "CALL A"
strParamStr = Trim(Session("A").ToString)
objDatAccess = New clsDATACCESS(strSQL, CommandType.StoredProcedure, strParamStr, "@DESC", SqlDbType.VarChar)

dtsCust = objDatAccess.getData
Session("DataA") = dtsCust.Tables(0)


ElseIf blntrigger(Session("trigger") = ddlBProc.SelectedItem) Then
strSQL = "Call B"
strParamStr = Trim(Session("B").ToString)
objDatAccess = New clsDATACCESS(strSQL, CommandType.StoredProcedure, strParamStr, "@DESC", SqlDbType.VarChar)

dtsCust = objDatAccess.getData
Session("DataB") = dtsCust.Tables(0)


I tried using session variable as above:Session("trigger") = ddlAProc.SelectedItem and Session("trigger") = ddlBProc.SelectedItem) but doesnt seem to be workable.

Thanks

Categories

Answer Discussion
Tutorials

 

PeterNZ

Date:: Aug 29, 2007

Time:: 15:50

I am not sure what "If blntrigger(Session("trigger") = ddlAProc.SelectedItem) Then " does? What is "blntrigger()"? Why can't you do a "If (Session("trigger") = ddlAProc.SelectedItem) Then "?

I suggest to debug and see if "Session("trigger") contains what you expect.

Another way to pass information to another web page would be using Query String Parameters in your URL. For example you amend your URL like this "http://myserver.com/mypage.aspx?trigger=... and in your code you use "Request.Params("trigger")" and get the value.

Hope this helps

Cheers

Peter

Devan Madhusudanv

Date:: Aug 29, 2007

Time:: 21:00

Thanks Peter,

Yup that blnTrigger does nothing here as the if then block works on boolean already.
However could you let me know further to use that query string param in my URL.

Cheers,
Devan

admin

Date:: Mar 04, 2009

Time:: 09:56

The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.

The Quomon Team

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Tutorials cannot be submitted until the Answer Discussion is complete.

Submit answers in the Answer Discussion area

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es