how i can get the one form variable values in other forms?????

iam going to pass values of one form to another formlike asfollows..


f1=CType(Context.Handler ,f1);

here f1 is form object this will be used in some other form.
iam try ing to use to global variables of first form in to second form.
while compilation it show s an error like as follws
:"

The name 'CType' does not exist in the class or namespace 'PassingValuesForms.Form2'

can you giv aslo pls..
thanks in advance..
rams


Cheers
Ram MCP
0
ramana123
7/25/2005 8:49:05 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

3 Replies
996 Views

Similar Articles

[PageSpeed] 18

CType is for the VB.NET language exclusively. By adding a semicolon to your code, I'm guessing you are using C#.
CType provides VB users with typecasting. In C#, the language has this syntax:

(class) object;

For example:
f1 = (Page) Context.Handler;  // f1 must also be a Page class
Note that you are trying to treat f1 as a Form (HtmlForm class). Context.Handler does not contain that class. It contains the Page object.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
0
PLBlum
7/25/2005 3:45:34 PM
thanks peter..


one more some small  doubt is what is the functionality of the "contextHandler"..
can you tell me pls.

regards
rams.

Cheers
Ram MCP
0
ramana123
7/26/2005 4:35:03 AM
Its not a simple concept. Each time the server has a transaction, it comes through something called an HttpHandler (which is a class designed to handle all kinds of transactions). There are different HttpHandler classes for different transactions. The most common transaction is a request from the browser for an aspx file (a web form), which creates an HttpHandler for the Page object used by the web form.
Context.Handler always specifies the current HttpHandler object.

I strongly encourage you to use the .net documentation to learn about specific objects in the framework. Start at msdn.microsoft.com/library.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
0
PLBlum
7/26/2005 3:01:10 PM
Reply:

Similar Artilces:

Request.Form does not get form values
Hi guys, I am new in ASP.NET 2.0 I am stuck with request.form problem I have simple asp:textbox and asp:button nested in the form with runat=server property, but when I want to get textbox value and response.write to page it gets empty, please look at code what do I do wrong?         <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>        <asp:Button ID="Button1" runat="server" Text="Button" />------------------------------------------------------------------------------------------...

getting values from a web form to windows form
Hot Requirement ..... Is there any possible of getting values from a web form to windows form ????? Yes One way i to use the WebRequest and WebResponse classes of the System.Net namespace. For example:  WebRequest request = WebRequest.Create("URL of the web page); WebResponse response = request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string content = reader.ReadLine(); ....    Reza Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way fut...

Form gets submitted even with wrong values
  I have created one webform in asp.net, when i enter the fields, all validations are working e.g: zipcode should be numeric, password > 6 etc... But even if i put wrong values in fields, validation errors get displayed then too i am able to submit the form and values gets stored in DB, where could be the gap !! ...hemen. Make sure you have your submit button set with CausesValidation="true"Scott was here... In your button click event, make sure your first line of code is...  if(!Page.IsValid){return;}   This will force the exit of the event prior to ...

Cannot Get Text Value Drop Down List In Form View Get NULL exception instead
Ok, I have a page with AJAX Tab Control, within a tab, I have a formview with checkboxes and a dropdownlist, I am trying to use the findcontrol to get the text value retuned when I select a value.  In this case an ageFrom and a AgeTo.  The findcontrol works fine when using it with checkbox controls, but when I try to use it with the dropdownlist control, I have been getting the NULL Exception error.  I have spent the greater part of the morning looking for an answer and yet to find what I am looking for.  I am using VB so please respond back with information refering to V...

After form submitted, how do I get one of the submitted values to display as a label
I can never seem to get this to work the right way.  I have a basic vb.net form that once a user submits, I want to display a label with the value they selected.  Do I need to re-query the db to get that value?  What's the easiest most efficient way to display a message indicating the value they submitted? Never make important decisions on a Monday! You can use viewstate. If you need it on multiple pages, then use session variable. A quick look here would be helpful. http://www.articlesbase.com/programming-articles/how-to-choose-from-viewstate-session-application-cache...

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

How to get the null values in my stored procedure i am getting error dbnullvalue on front end aspx form
I have the following stored proc. which i am using on the front end to get all the record from table: if there are any fields it has anynull values in it i am getting error dbnull value error. i have null value for ReviewerComment field, can you please tell me how to pass a "" if it is null, in the store proc only, to get all the fresh dat to front end before bnding it to the datagrid control. CREATE PROCEDURE [dbo].[sp_displayrevws] AS select r.RevID, rtrim(f.revwfunction) as revwfunction, rtrim(u.uname) as uname, CONVERT(varchar(10),r.Issued,101) as I...

Getting the values form the previous form and re-use in saving connection doesn't work...
Hello,I have a web form and each web form is saving to a specific user folder.  When the user login with their username and password and go to the web form, fill-out all the information and save to the user folder database, the saving data to the database is working, but now I want to change the directory of the saving data to a specific user folder control db that based on the username, but seems like didn't get to the right user valid path, So instead of this directory 'C:\WINNT\profiles\controls\test.mdb' , I want to save it in a user folder database with their username l...

Why can i set & get a ViewState variable with no form runat=server?
Hi there I've been experimenting with tunring off the web form runat=server to see how clean i can make the HTML. One of may pages has a list of news items with paging that is defined in a base page class. The paging relies on several public properties for PageIndex, PageSize, ResultCount and PageCount. I just realised those public properties use the ViewState to maintain the values e.g:         public int PageIndex        {            get  ...

how to get form value??
Hi, I am using HTML input textbox AND web control input textbox ... BOTH DUN RETURNS VALUE WHEN I CLICKED ON THE SUBMIT BUTTON. HELP!!! :( ============= test.aspx ========= <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server" method="post" action="getTest.aspx"> <div> <a href="manage.aspx?db=27">Enter!</a> <br /> <br /><input runat=server type=text name="nn" value="something here" id="nn" /> <br /> <br ...

IN VS.Net how can i get a web form to scroll (design mode)
In design mode in VS.Net, there is a scroll bar next to the web form, but it is grayed out.  I can not figure out how to enable it.  I want to design a web form that is larger in size than the surface area shown in teh deisgn window.  Can someone help out with this?Thank you. VS design surface shows how the page is going to be rendered in the browser. Therefore, there is no 'virtual' large size. In the browser scroll bar appears if the browser window is smaller than the page content. You can make scroll bar to appear by enclosing page content in a large container e...

get all form values
Hi, I'm sure this is totally simple but I'm just learning .net. I've built a form with c#. None of the fields are required. There are a bunch of radio groups. The default value for nothing selected appears to be -1. I would like to write something that checks all values and changes the -1 to 999 before I update the database. How can I check all the form values? Thanks to anyone who can help. Hello, once you create your form, you will have the button_firing_method, there you can access each field in the form by just using this: string s = textbox1.text; and you can do the same f...

Get Error: A Page can have only one server-side Form tag
I have 2 ascx files, and would like to display all objects in 1 aspx page. I use the following code, but I got "A Page can have only one server-side Form tag" error. Does anyone know how to solve that problem? Thanks <%@ Page Language="VB" Debug="true"%> <%@ Register TagPrefix="report" TagName="PQATestResultPage" Src=PQATestResultPage.ascx" %> <%@ Register TagPrefix="report" TagName="PQAPRPage" Src="PQAPRPage.ascx" %> <html> <body> <report:PQATest...

Getting A page can have only one server-side Form tag. From a sub
I have a form which pulls data from a database and fills out the form based on some user input. I am then trying to take the filled out form and send it via email to This error is virtually always correct, that you have more than one server side FORM tag.  It especially happens with Master Pages, since the master has the FORM tag already.  Go through your code and make sure there is only on tag, and that everything for the form is inside the tag. JeffPlease: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know whic...

Web resources about - how i can get the one form variable values in other forms????? - asp.net.getting-started

Form - Wikipedia, the free encyclopedia
Form is the shape , visual appearance , constitution or configuration of an object. In a wider sense, the form is the way something is or happens, ...

Terror groups form Islamic State powerhouse in the Philippines: video
Four Islamic terrorist groups in the southern Philippines have merged to form a satellite extension of Islamic State, according to a video posted ...

Thunder form wavers in face of blistering Heat
CHRIS Lynn went smash in the Big Bash splash as the Brisbane Heat chased down a massive total of 187 with three balls to spare to beat the Sydney ...

South Africa vs England second cricket Test: Hashim Amla returns to form as England toil
Captain Hashim Amla emerged from a year of poor form with a dogged century to lead a South Africa fightback in the second Test against England ...

Ohio Removes Question About Driver's Licenses From Job Form
Ohio has removed the question asking job applicants if they have a driver's license from the state's online hiring system.

Fullscreen, GroupM Ink Deal to Form Influencer Marketing Program
For more brands to put money toward video deals with digital celebrities, or influencers, it needs to become easier for the brands to pick out ...

How An NBC News Producer Was Wooed By ‘The Extreme Form of a Con Man’
... at the center of it. Take some time to read Vanity Fair’s extraordinary tale of award-winning NBC News producer Benita Alexander and her former ...

WaPo columnist says: "Although Muhammad is not depicted, the idea of religion in some form as a villain ...
... for The Post's Book World." There's no detail to his idea that the character on the cover represents "the idea of religion in some form as a ...

Pro-Independence Spanish Parties Strike Deal to Form Government, New Catalan Election Called Off; Expect ...
... parties could not resolve their differences. Today, the bickering parties set aside those differences in a striking deal to form a new government, ...

Merchandise singer forms Death Index, releasing debut album on Deathwish
by Andrew Sacher People like to talk about Merchandise's punk roots, but if you wished they sounded more punk, you're in luck. Frontman Carson ...

Resources last updated: 1/10/2016 9:33:45 PM