Declare A Variable That Never Change From Pageload Until Close The Page?
Sep 15, 2009
How to declare a variable that never change from pageload until i close the page. Simple Case :
* ShowInfo.PageLoad() begins to execute for UserA.
* ShowInfo.Page_Load() begins to execute for UserB
* UserA has variable Dummy = 100.
[code]....
But the Result: Since UserB's was the last one assigned to (which remember... there is only one version of this in all of memory), the Dummy Variable is assigned for both users but different session. UserB sees Dummy = 20 but UserA sees Dummy = 20 too. I Want that the result is UserA Dummy = 100 & UserB Dummy = 20?
View 6 Replies
ADVERTISEMENT
Feb 2, 2010
i am new to this. i have 4 pages. login.aspx, account.aspx, settings.aspx and fliers.aspx.
its all programmed in vb.net with sql server backend.on my firstr page, login.aspx i have this code in the .vb page -
Dim SQL As String = "SELECT * FROM table1 WHERE email='" + Me.txtUserName.Text + "' AND password='" + Me.txtPassword.Text + "' "
ExecuteNonQuery(SQL)
[code]...
View 3 Replies
Dec 23, 2011
I have created a form to update an access DB table. My issue is that when the text in the text boxes is changed and the form is submitted, the .text values stay the same as they were when the datareader loaded them on the page load event. How can I submit the values that the user updates, not what is already there from page load.[code]...
View 1 Replies
Dec 27, 2010
I have a MainPage - mainpage.xaml Inside the MainPage I have a frame that hosts other pages. The first page that is auto loaded is the LogIn - LogIn.xaml
The user enters their email to login (no password required, just email to identify, its an internal app so passwords are not required or even wanted by users).
On MainPage.xaml the header should have a "Hello " TexBlock (name: ui_txbUserName). The LogIn page has a method which on submit gets the UserID (for other reasons and saves it) and the User Name.
I want to change the ui_txbUserName when the person logs in and update if he/she logs out of one account into another. I have looked at INotifyPropertyChanged and Dependency Properties and im just not sure how to go about doing this!
View 1 Replies
Dec 26, 2010
I have a MainPage - mainpage.xamlInside the MainPage I have a frame that hosts other pages. The first page that is auto loaded is the LogIn - LogIn.xamlThe user enters their email to login (no password required, just email to identify, its an internal app so passwords are not required or even wanted by users).On MainPage.xaml the header should have a "Hello " TexBlock (name: ui_txbUserName). The LogIn page has a method which on submit gets the UserID (for other reasons and saves it) and the User Name.I want to change the ui_txbUserName when the person logs in and update if he/she logs out of UsingOfficerID - its a global variable set when a person logs in, its used all over the place in the application.
View 2 Replies
Mar 29, 2012
I have 2 web pages. In the first webpage I have a text box which takes an user input.The number of controls rendered in the second page is based on the user input in the first page.I am storing the user input from the first page as a session variable [code]Now, I wish to use this session variable in the next page for initializing a global variable and what I tried to do is Dim num_Invitees As Integer = CType (Session("NoOfControls ToGenerate"),Integer)But this gives me a NullReferenceException.Can someone please suggest me what exactly I should be doing in order to use the session variable to initialize a global variable and also why the session variable's value is null while using outside a function but works fine when used inside a function?
View 1 Replies
Dec 2, 2009
What's the C# equivalent of
<% dim name %>
so you can use it for web forms in PayPal API integration?
View 3 Replies
Feb 6, 2011
why don't we declare a variable for instance variable with dim not private?
View 3 Replies
Nov 17, 2011
I have a parent page and child page, both aspx. All is working, but now I would like to close child page, if user leaves child popup page and goes back to parent page and clicks on something else like page index of Gridview. I CANNOT close popup child page if user goes to another app, or some other location, I only want to close if something on parent page is changed.
I have the PageIndexChange Event set up for other purposes, I would just like to add some functionality, perhaps a script manager to close the child popup page if the Gridview index is changed, java or another way which ever works best.I think I might also need to check if the child page is even open.
[Code]...
View 1 Replies
Jan 24, 2011
I want to know if it is possible to declare a variable thrice.
[code]...
View 1 Replies
Jul 21, 2009
I have a form with 2 controls, a textbox and a button. The user will type text into the textbox and then when they click the button the text that they entered will be added to a List Collection. You can see the code below. There is just 1 problem. Where would I put my declaration of my List Collection so that it holds the values and does not start at the first element everytime the button is clicked?[code]
View 5 Replies
Oct 21, 2011
I have been debugging my code for a while and looking at posts in other forums, but it seems to be that everyone has a different problem than mine and what works for them will not work for me.My dropdown list is supposed to filter a gridview by choosing all the Companies that are associated to a certain product. The solution I have found online is that most people did not have DataKeyNames set in their gridview. I do have this set, but not to CompanyID. It wouldn't make any sense. So I have no idea what I am supposed to do since this is the only answer I have found.
<asp:DropDownList ID="ddlCompany" runat="server" DataSourceID="dsCompanyFilter"
DataTextField="CompanyName" DataValueField="CompanyID" AppendDataBoundItems="true"
AutoPostBack="true">
[code]....
View 2 Replies
Apr 1, 2009
How do you declare a variable as a Date and initialize it with a date before year 1. I would like to caluate historical BC dates using a fuction that returns the ellaspt time.
I've used this line of code however I can't to work setting the date value to a negative.
Dim
myDate As Date = CDate("2/6/1400")
View 2 Replies
Mar 18, 2011
why we can't declare a variable on some class such as math
for example?
dim s as new math
?
but we should imports them..
View 17 Replies
May 9, 2012
I have searched online for a few hours to try to figure out how to do this, but nothing I found really makes sense, so could someone please tell me, in a simple way, how to do this?
Let's say I have a text box that the user fills out, named textbox1. And I have a combo box, named combobox1, which contains the choices A, B, C. And then I have a button named submit_button.
Each time that the user clicks submit_button, I would like to dynamically create a new variable. This variable should be named the same as textbox1.text, and should contain the value of combobox1.
For example, if the user types "blue" into textbox1, and chooses value "C" from combobox1, and then clicks submit_button... then the following variable should be dynamically created, like..Dim blue as String = "C"
And then, after that, if the user types "red" into textbox1, and chooses value "B" from combobox1, and then clicks submit_button... then another variable should be dynamically created, like...
Dim red as String = "B"
And each time the user submits new information into the textbox and combobox, a new variable should be created.Is it possible to have the program automatically create variables like this? If so, how?
My actual project is much more complicated than this, of course, so the above is just an example. But if I could figure out how to solve the problem in this example, I could figure out how to solve the entire project.
View 6 Replies
Jan 21, 2012
I can declare a variable in VB.NET that stays even after closing and re-opening the program?
View 2 Replies
Dec 7, 2010
What i am trying to do is this:
Dim Name as string
Name = "Bob"
Dim Name.tostring as Integer
Which will create as variable called Bob of type integer.
But obviously this code doesn't work. So what is the real way to do this if it can be done?
View 2 Replies
Nov 11, 2010
how to declare out global variable? i tried out but get error.. below is my orginal code
[Code]....
View 1 Replies
Jan 7, 2011
I'm trying to make a message box appear, I don't want to have to declare the message box as a variable, And I don't want it to be in it's own Sub!I just want it to print (variable) S, It's in a sub. Just not sure of the structure of that code. Just a really quick example
View 1 Replies
Mar 17, 2009
What's the main problem if I don't declare the type of a variable? Like, Dim var1 versus Dim var1 as Integer.
View 6 Replies
Nov 18, 2009
I am working on an alarm system software, which is SMS-based. I am using a GSM modem to receive the SMS when a client's premise security devices are triggered. The types of SMS text received will be like for e.g. "fire alert"(when devices triggers), "fire clear"(when devices are 'reset').
My program can detect real and false alarm, it works this way, i will input a premise site-map on a picture box at the main GUI, i can then create buttons at run-time and drag them to the respective position on the map. The buttons created have their text set as the client's block number referred to the database. So basically, a button represent a client. When a device in the client's premise is triggered, a SMS will be sent and my GSM modem will receive it, process the SMS and the button representing the client will start 'flashing' showing that the client's premise is under danger. Then when the button is clicked, which acts as an acknowledgement, will display the client's information on labels and turning that specific button to red color. Finally, when the device is 'resetted' in the client's premise, it will send another SMS to my GSM modem, after processing, the button will be back to normal.
But my program has detect false alarms also, the first part is similar to mentioned above, client's premise security device triggers, SMS sent, SMS received by GSM modem, process SMS, button 'flashing'. Secondly, if the alarm is false, it will be automatically 'resetted' or the client may 'reset' it, then a SMS will be sent to my modem, turning the button to 'flashing' green in color. when 'acknowledged' will display the client's info and the button will become normal.
The problem here i am facing is during the processing of the SMS, because the real and false alarms both will receive the 'clear' SMS when during some stages, but the functions are different and of course the 'checking' for both functions will be different too. The problem occurs at the checking process whereby the 'btn' variable is not detected.
'Try
'AT commands to receive SMS
serialPort.Write("AT+CMGL=""REC UNREAD""" & vbCrLf) 'set command message format to text mode(1)
[Code]....
View 1 Replies
Apr 23, 2012
Later on i have a form where a cost for a class is calculated by timing the duration of a class by the costperhour textbox which is in a different form.
View 3 Replies
May 11, 2010
the error is pointing at : objAdapter.Fill(objDataSet, "placename")
the following is the code that is throwing an error.
Dim selectedname
As
String = "boston"
[Code]...
View 6 Replies
Jan 9, 2012
Must Declare Scalar Variable @ID?
View 11 Replies
May 16, 2012
This seems so basic but I've been struggling to find a solution! I have a web page that take user data from aspx textboxes. Upon hitting a button, the click event submits the responses to a SQL table. Seems easy.I'm using VS10, dev express and VB code. I have established my datacontext class using LinqToSql...In a nutshell, the code is as follows...within the click eventNote that "database" was earlier defined as my datacontext sql connection, "Request" tablee
Dim vname As String = AspxTextbox1.Text
database.executecommand("INSERT INTO [Requests] (ContactName) Values (@vname)")
[code].....
View 8 Replies
Apr 6, 2010
im having this prob, when deleting a line from my gridview, this error shows out.Must declare the scalar variable "@productid".Well, i dont know whats wrong with the coding. As i have already declared the productid.
<table style="width:100%;">
<tr>
<td class="style24" colspan="2">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
[code]....
View 2 Replies
Oct 9, 2011
vb.net
Public Class UniQueGlobalConnector Public GlobalConnection As New OleDb.OleDbConnection Private Sub OpenConnection() Dim UniqueConnectionName As String = "GlobalConnection" & (Rnd(10)).ToString.Replace(".", "_") Dim InternalConnection As New OleDb.OleDbConnection GlobalConnection = InternalConnection
[Code]...
View 3 Replies
Jan 1, 2012
What I am trying to do, is perform some edit checks on required fields in my page. When the "Submit" button is clicked, I wish to check execute a javascript function that does these checks.
The way I'm envisioning it is to declare a server-side variable in my VB.Net code-behind, set this value in the javascript CheckEdits() function and then back in the code-behind in the btnSubmit_Click() Event, check this variable.
View 5 Replies
Jun 21, 2010
I need regarding declarations of global variable.. I created a module here is the script.
[Code]...
and then I set the value of that variable in my Login form and then my PROBLEM is when accessing it on the my Main form and I want to display the data of that variable in a textbox, the variable does'nt hold the value that I already set. I'm waiting for replies!
View 2 Replies
Oct 25, 2006
How can i declare a static variable as global in vb.net?(Global static variable)
View 5 Replies