Hello,
I have created Sub that requires one argument which is a string. However,
when I run the Sub, the string is not passed as it should be. Here is the
code
Public Sub fCrewLookup(ByVal x As String)
CrewPos = x
Me.AddCrew.Visible = False
Me.CrewLookup.Visible = True
SqlDataAdapter3.Fill(DataSet41)
dgCrewLookup.SelectedIndex() = -1
dgCrewLookup.DataBind()
End Sub
Private Sub ibPFLookup_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles ibPFLookup.Click
fCrewLookup("PF")
End Sub
And finally what is supposed to be the result:
Private Sub CrewLookupSelect_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CrewLookupSelect.Click
If dgCrewLookup.SelectedIndex < 0 Then
MessageBox.Show("Please select a crew member.", "Selection Error",
MessageBoxButtons.OK, MessageBoxIcon.Information,
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Else
Dim sUID As String
sUID = dgCrewLookup.SelectedItem.Cells(0).Text()
PFID.Text = CrewPos
Me.CrewLookup.Visible = False
Me.AddCrew.Visible = True
End If
End Sub
End Class
The variable CrewPos is declared as a variable in the Public Class block so
that it is global in scope to the entire application.What am I missing that
is not causing the argument to be passed? This works fin in VB.NET, but not
using VB in ASP.NET.
Thanks in advance,
Kris 4 1721
gowd, i hate to look at vb code...arggggghhhh
The web environment operates differently than the windows environment. Your
CrewPos = x assignment lasts exactly as long as the sub routine executes
then it is gone. You will need to persist it to storage so it can survive
the posting process. If you store it in viewstate for example, then when you
need it in the click routine, pull it out of viewstate and use it.
On each post, nothing lasts unless it is explicitly stored in a database, or
cached in storage.
It may be worth your while to read up a little on the web architecture and
the ASP.NET paradigm
--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kris Rockwell" <kr***************************@hybrid-learning.com> wrote in
message news:Ov*************@tk2msftngp13.phx.gbl... Hello,
I have created Sub that requires one argument which is a string. However, when I run the Sub, the string is not passed as it should be. Here is the code
Public Sub fCrewLookup(ByVal x As String)
CrewPos = x Me.AddCrew.Visible = False Me.CrewLookup.Visible = True SqlDataAdapter3.Fill(DataSet41) dgCrewLookup.SelectedIndex() = -1 dgCrewLookup.DataBind()
End Sub
Private Sub ibPFLookup_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibPFLookup.Click
fCrewLookup("PF")
End Sub
And finally what is supposed to be the result:
Private Sub CrewLookupSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrewLookupSelect.Click
If dgCrewLookup.SelectedIndex < 0 Then
MessageBox.Show("Please select a crew member.", "Selection Error", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Else
Dim sUID As String
sUID = dgCrewLookup.SelectedItem.Cells(0).Text()
PFID.Text = CrewPos
Me.CrewLookup.Visible = False
Me.AddCrew.Visible = True
End If
End Sub
End Class The variable CrewPos is declared as a variable in the Public Class block so that it is global in scope to the entire application.What am I missing that is not causing the argument to be passed? This works fin in VB.NET, but not using VB in ASP.NET. Thanks in advance,
Kris
gowd, i hate to look at vb code...arggggghhhh
The web environment operates differently than the windows environment. Your
CrewPos = x assignment lasts exactly as long as the sub routine executes
then it is gone. You will need to persist it to storage so it can survive
the posting process. If you store it in viewstate for example, then when you
need it in the click routine, pull it out of viewstate and use it.
On each post, nothing lasts unless it is explicitly stored in a database, or
cached in storage.
It may be worth your while to read up a little on the web architecture and
the ASP.NET paradigm
--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kris Rockwell" <kr***************************@hybrid-learning.com> wrote in
message news:Ov*************@tk2msftngp13.phx.gbl... Hello,
I have created Sub that requires one argument which is a string. However, when I run the Sub, the string is not passed as it should be. Here is the code
Public Sub fCrewLookup(ByVal x As String)
CrewPos = x Me.AddCrew.Visible = False Me.CrewLookup.Visible = True SqlDataAdapter3.Fill(DataSet41) dgCrewLookup.SelectedIndex() = -1 dgCrewLookup.DataBind()
End Sub
Private Sub ibPFLookup_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibPFLookup.Click
fCrewLookup("PF")
End Sub
And finally what is supposed to be the result:
Private Sub CrewLookupSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrewLookupSelect.Click
If dgCrewLookup.SelectedIndex < 0 Then
MessageBox.Show("Please select a crew member.", "Selection Error", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Else
Dim sUID As String
sUID = dgCrewLookup.SelectedItem.Cells(0).Text()
PFID.Text = CrewPos
Me.CrewLookup.Visible = False
Me.AddCrew.Visible = True
End If
End Sub
End Class The variable CrewPos is declared as a variable in the Public Class block so that it is global in scope to the entire application.What am I missing that is not causing the argument to be passed? This works fin in VB.NET, but not using VB in ASP.NET. Thanks in advance,
Kris
Alvin,
Thanks for your reply. It has cleared up a few things.
I am actually quite familiar with web achitecture, it just happens to be the
old ASP that I have worked with. I'd love to make the jump to using C#, but
time doesn't allow for that at this point.
Regards,
Kris
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:#t**************@TK2MSFTNGP12.phx.gbl... gowd, i hate to look at vb code...arggggghhhh
The web environment operates differently than the windows environment.
Your CrewPos = x assignment lasts exactly as long as the sub routine executes then it is gone. You will need to persist it to storage so it can survive the posting process. If you store it in viewstate for example, then when
you need it in the click routine, pull it out of viewstate and use it.
On each post, nothing lasts unless it is explicitly stored in a database,
or cached in storage.
It may be worth your while to read up a little on the web architecture and the ASP.NET paradigm -- Regards, Alvin Bruney [ASP.NET MVP] Got tidbits? Get it here... http://tinyurl.com/27cok "Kris Rockwell" <kr***************************@hybrid-learning.com> wrote
in message news:Ov*************@tk2msftngp13.phx.gbl... Hello,
I have created Sub that requires one argument which is a string.
However, when I run the Sub, the string is not passed as it should be. Here is
the code
Public Sub fCrewLookup(ByVal x As String)
CrewPos = x Me.AddCrew.Visible = False Me.CrewLookup.Visible = True SqlDataAdapter3.Fill(DataSet41) dgCrewLookup.SelectedIndex() = -1 dgCrewLookup.DataBind()
End Sub
Private Sub ibPFLookup_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibPFLookup.Click
fCrewLookup("PF")
End Sub
And finally what is supposed to be the result:
Private Sub CrewLookupSelect_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles CrewLookupSelect.Click
If dgCrewLookup.SelectedIndex < 0 Then
MessageBox.Show("Please select a crew member.", "Selection Error", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Else
Dim sUID As String
sUID = dgCrewLookup.SelectedItem.Cells(0).Text()
PFID.Text = CrewPos
Me.CrewLookup.Visible = False
Me.AddCrew.Visible = True
End If
End Sub
End Class The variable CrewPos is declared as a variable in the Public Class block so that it is global in scope to the entire application.What am I missing that is not causing the argument to be passed? This works fin in VB.NET, but not using VB in ASP.NET. Thanks in advance,
Kris
Alvin,
Thanks for your reply. It has cleared up a few things.
I am actually quite familiar with web achitecture, it just happens to be the
old ASP that I have worked with. I'd love to make the jump to using C#, but
time doesn't allow for that at this point.
Regards,
Kris
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:#t**************@TK2MSFTNGP12.phx.gbl... gowd, i hate to look at vb code...arggggghhhh
The web environment operates differently than the windows environment.
Your CrewPos = x assignment lasts exactly as long as the sub routine executes then it is gone. You will need to persist it to storage so it can survive the posting process. If you store it in viewstate for example, then when
you need it in the click routine, pull it out of viewstate and use it.
On each post, nothing lasts unless it is explicitly stored in a database,
or cached in storage.
It may be worth your while to read up a little on the web architecture and the ASP.NET paradigm -- Regards, Alvin Bruney [ASP.NET MVP] Got tidbits? Get it here... http://tinyurl.com/27cok "Kris Rockwell" <kr***************************@hybrid-learning.com> wrote
in message news:Ov*************@tk2msftngp13.phx.gbl... Hello,
I have created Sub that requires one argument which is a string.
However, when I run the Sub, the string is not passed as it should be. Here is
the code
Public Sub fCrewLookup(ByVal x As String)
CrewPos = x Me.AddCrew.Visible = False Me.CrewLookup.Visible = True SqlDataAdapter3.Fill(DataSet41) dgCrewLookup.SelectedIndex() = -1 dgCrewLookup.DataBind()
End Sub
Private Sub ibPFLookup_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibPFLookup.Click
fCrewLookup("PF")
End Sub
And finally what is supposed to be the result:
Private Sub CrewLookupSelect_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles CrewLookupSelect.Click
If dgCrewLookup.SelectedIndex < 0 Then
MessageBox.Show("Please select a crew member.", "Selection Error", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Else
Dim sUID As String
sUID = dgCrewLookup.SelectedItem.Cells(0).Text()
PFID.Text = CrewPos
Me.CrewLookup.Visible = False
Me.AddCrew.Visible = True
End If
End Sub
End Class The variable CrewPos is declared as a variable in the Public Class block so that it is global in scope to the entire application.What am I missing that is not causing the argument to be passed? This works fin in VB.NET, but not using VB in ASP.NET. Thanks in advance,
Kris
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Pavils Jurjans |
last post by:
Hallo,
I have been programming for restricted environments where Internet Explorer
is a standard, so I haven't stumbled upon this problem until now, when I
need to write a DOM-compatible code.
...
|
by: domeceo |
last post by:
can anyone tell me why I cannot pass values in a setTimeout function
whenever I use this function it says "menu is undefined" after th
alert.
function imgOff(menu, num) {
if (document.images) {...
|
by: Harolds |
last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005
the pmID is evaluated to "" instead of what the value is set to:
....
xmlItems.Document = pmXML
// Add the pmID...
|
by: Mike MacSween |
last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime
ago.
Then remembered that arguments are passed by reference, by default.
Does the fact that this slowed me down...
|
by: Michael |
last post by:
Hi,
once I read here that it is not 'a good idea'
to pass variables that are not initialized to
a function.
I have
void something ( double *vector );
....
|
by: Mantorok |
last post by:
Hi all
I'm pretty new to ASP.Net, is it possible to pass arguments (maybe objects
too) to web forms without using a querystring in the URL?
Thanks
Kev
|
by: Justine |
last post by:
Can anyone help?
e.g. when you open a vb project property page, in "Configuration
Properties"
You will see "Command line arguments" in "Start Options". Does anyone
knows how to find a way to do...
|
by: Bonzo |
last post by:
>From within a function, I want to pass a/some parameters to another
function, AND all arguments, passed into this function.
e.g.
function firstFunction(){
//this function may have been...
|
by: william.w.oneill |
last post by:
I have an application that takes a few command line parameters. As
recommended by others in this group, I'm using a named mutex to ensure
that only one instance of the application is running. My...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |