VS 2008 Passing A Variable Between Two Protected Subs?
Aug 31, 2010
I hope this is simple but I can't find any information when searching Google about passing a variable between two Protected Subs.
When I use the fileUpload tool within my webform I need to take the filename chosen and use it in a different Protected Sub
View 8 Replies
Similar Messages:
Sep 21, 2010
How do i call a variable in different subs on the page? I know I need to create a Private_Sub....? But I don't know the how to complete it. For example, I have the following code in a Button Click event. But I also need xamount in a different Button Click for the same page. Like I said, I believe I need something like a Private_Sub or Protecetd_Sub (not sure which one and why) with a made up name to reference it....like Private_Sub subXAmount, but I don't know how to complete it and then reference it.
[Code]....
View 2 Replies
May 9, 2010
I'd like to know how to declare a variable in my code behind page that I can use in all the subs of my code behind.
I tried in after the Partial Class declaration to declare a "Public String" :
[Code]....
and to use it in my subs but when I use it from a sub to another I loose the value affected in another sub.
Is there a way to use a Public variable from a sub to another (I'm actually using a session variable in order to do it and I'm not sure it is the best way)
View 4 Replies
Mar 25, 2010
I have code examples from some of my previous work that help me to post form values to a web page (login credentials) and retrieve the text from that page. Now I want to pass in form values (login credentials again) but actually open that web page in a browser given those credentials.How do I do that? I'm not doing anything nefarious. In our CRM app (home-grown as it is), I want to create a link button that opens our web site's protected products page given the user's credentials (based on the user's login credentials). Normally, I'd copy the user's credentials in our login page which then takes me to the products page.
View 1 Replies
Sep 8, 2010
I have set up a directory on my IIS web server that is protected by "Integrated Windows authentication". I want visitors to be required to enter a name and password to view files in the protected directory except if they are following a link to files in the protected directory from a certain page on my website.
I am doing this to try to get better protection from search engine spidering than is provided by using a robots.text file.
I am using ASP.NET 3.5 with VB. I am wondering if there is a way to pass the log on credentials to the IIS server via a link, or if there is a way to fill in the name and password for the login screen automatically, or something else that would work. It is OK if the login name and password are visible to the visitors.
View 3 Replies
May 27, 2010
I have this sub in a class modulePublic Shared RunMySub(ByVal P as Page) 'I need page ref in the class sub to clear cache like
P.Cache.Remove("MyCache")
end sub
When I call this sub 'RunMySub' from a page, it works fine, ok, great !BUT now I need to run it from another class module...so I did this
Dim mpage As New Page
RunMySub(mpage)
mpage = Nothing
I get the error : Cache not available...How can I pass a page from another class module , thats not a page, or some how manage cache functions on a class module without pass the page varible ???
View 2 Replies
Nov 15, 2010
I just need to know how to pass a javascript variable to c# when i click on a button
View 2 Replies
Feb 22, 2011
I have this string variable:
[Code]....
I want to pass the string MON to the sql query: to replace trunc(sysdate) .
[Code]....
View 3 Replies
May 19, 2010
I am thinking this is a pretty simple problem... but I can not get it to function.I just want to get the calendar control to change a date which subsequently modifies a database select statement. I can get the current code to process without error, but the variable set is always a click earlier. Of course, I want the variable to be set upon any change in the calendar control.
public partial class NewBusinessReport : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
[code]...
Does this make sense? I just want it so that when SelectionChanged gets fired the Calendar1SelectCommandDate passes the correct date to the Page_Load page. The error I get now is:"The name 'Calendar1SelectCommandDate' does not exist in the current context"I get that the variable does not exist in the context. That actually seems to make sense based on what I have coded; however, I try to get that variable established and I still seem to be headed in the wrong direction.Basically, I have four calendar controls, one for a date (period 1 start, end and then period 2 start, end). I want to set the program so any change in that date sets off a new Select statement into the SQL server.
View 1 Replies
May 3, 2010
want to use the value of a variable on to the other page, what i am supposed to do for that.i am novice at asp.net
View 8 Replies
Jul 7, 2010
I am trying to pass a variable within a selectcommand statment in ASP.NET and I have researched online how to do it but I can't seem to find a way to do it...What I am trying to do is write a code for a web page that will display a page with useful links on it where the links are separated into different topics and where everything is dynamically grabbed from a database. This is what I have so far:
<!-- Start MainContentRegion -->
<h1>Useful Links</h1>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
[]code...
View 4 Replies
Jul 1, 2010
protected void saveMergedFile(string[] ReportFiles)
{
foreach (string item in ReportFiles)
{
[code]...
View 24 Replies
Feb 24, 2011
I am using ASP.NET MVC 3 and the YUI library.I created my own helper method to redirect to an edit view by passing in the item's ID from the Model as such:
window.location = '@Url.RouteUrl(Url.NewsEdit(@Model.NewsId))';
Now I am busy populating my YUI data table and would like to call my helper method like above, not sure if it is possible because I get the item's ID by JavaScript like:
var formatActionLinks = function (oCell, oRecord, oColumn, oData) {
var newsId = oRecord.getData('NewsId');
oCell.innerHTML = '<a href="/News/Edit/' + newsId + '">Edit</a>';
};
View 1 Replies
Sep 4, 2010
I have 10 hyperlink controls. Depending on which hyperlink is pressed I want to pass a value to the target page. I think the easiest way would be to pass the value using URL of the hyperlink controls. Something like <asp:HyperLink ID="HyperLink1" NavigateUrl="~/News.aspx?id=>. I can pass just a value, but I want to pass a value from a variable.
<asp:HyperLink ID="HyperLink1" runat="server"
View 3 Replies
Nov 18, 2010
I need to make the connection string in my vb.net web application be passed into the app externally. This is so I can re-driect the app to use either a test or production database. The same idea as a .INI file in a windows base system. someone suggested to me I use XML but I dont know how to do that.
View 13 Replies
Mar 10, 2011
I cant get this right
[Code]....
Where PKey is a variable that holds the Datakey
View 8 Replies
Feb 27, 2011
I have a SQL stored procedure on a SQL server that uses a variable to create a new database. This works in SQL I have a connection string that works I have added a sqldatasource to a webform, and configured the datasource to connect to the remote SQL database and am able to select my stored procedure. I am able to bind the variable to a control in the sqldatasource wizard (often two of the same control appear- if that is significant)
When I test the sqldatasource in the configuration wizard and put in a manual entry, the procedure runs and works
It is on the web page I am having troubles. I want the user to enter a name in a text box, click a button/link, and run the procedure. Ive used buttons and links...but not in the right way I think, becuase when I click them the stored procedure doesnt run.
As mentioned above, I have selected the right control in the sqldatasource wizard. So what do I need to do now?
Is it button click event? If so whats the syntax?
Should I be embedding my textbox in a dataview?
View 4 Replies
Jan 24, 2011
I am using ASP.NET 2.0 and C#. I have a gridview, which has a datanavigateurlformatstring, in which i am passing data in the gridview as querystrings.I have a hiddenvariable in the page. i would like to pass the hidden variable to the gridview in the datanavigateurlformatstring.Currently i have the gridview and hidden variable like this:
[Code]....
How to pass the hiddenfield value in the datanavigateurlformatstring?
View 3 Replies
Feb 18, 2011
can I pass a variable from code behind to a javascript function. if so, do you have a sample demo.
View 1 Replies
May 20, 2010
Can I code to add transaction for some subs? If there is an error in any sub will roll back.For example, sub1 delete some tablessub2 insert data into tables which just be deletedsub3 send out confirmation emailsub4 make submit button disable
View 3 Replies
Aug 6, 2010
the best place to store Subroutines and Functions for global access for a beginning programmer:
-As a .dll file (class library) in the bin folder?
-As seperate classes under the App_code directory?
-or just all together in the code behind on a blank page?
View 3 Replies
Jun 22, 2010
If I do thisPublic PageDetail As CoreBO.GetStartUpDetails = PageCoreBLL.InitialSetup(DomainName)
[Code]....
Where GetStartUpDetails is a structure in the Business Objects Layer In my page subs is their a performance differance between writing
sub xx
Dim test as pagedetails.structure1
response.write (test)
end sub
or just response.write (pagedetails.structure1)
View 1 Replies
Feb 22, 2010
i want to pass values between forms. wat i did is, I have textbox, a button in form 1 and a label in form 2
1. Created a property to return text of textbox in form 1
2. in form 2 i added previouspagetype and virtual address then i tired to access the property (label.text = previouspage.propertyname).. but no success..
i tried to loop through all controls in previous page to get the value but still its not working.. i wan a simple way.. without using sessions, cookies or anything..
View 19 Replies
Jul 6, 2010
i want to pass a query string with window.open of javascript
but since the sql query uses single quotes, there is some error
How can i handle this
Given below is the sample(The starting quote of SalesEmp is ending the single quote where window.open has started)
javascript:void(window.open('DetailedGraph.aspx?SqlQry=select SlpName, MonthYear, Sum(DocTotal)/100 Invtotal, max(Year) Year, max(MonthNum) MonthNum from OCT_VIEW_DB_Sales where SlpName='SalesEmp' ')
View 7 Replies
Mar 1, 2012
I can't figure out how to do this. I have a gridview and I want the user to click on a row and pass some of the cell data to a model popup. For example, if I have a button called Delete on each row and they click the button, I want to popup a box to show the data from that row and ask to confirm to delete. I also need to use the data from that row to delete when they click Yes.
I'm sure I just missed on how to do this from searching. I'm looking for an example on the web.
View 1 Replies