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
Status:
Open Aug 27, 2007 - 06:00 PM
3answers
Answers
Aug 29, 2007 - 12:50 PM
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=SomeValue" and in your code you use "Request.Params("trigger")" and get the value.
Hope this helps
Cheers
Peter
Aug 29, 2007 - 06:00 PM
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
Mar 04, 2009 - 05:56 AM
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
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment