473,659 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Values Between Web Pages

Vkas
78 New Member
HELLO!!!!!!!!!! !!!
me using
ASP.net 2.0, language VB.net!
working tool Visula studio.Net 2005

I HAVE CREATED A simple WEB User control (calender.ascx) having
a text box ,
a button,
and a calender control

Expand|Select|Wrap|Line Numbers
  1. <%@ Control Language="VB" AutoEventWireup="false" CodeFile="calender.ascx.vb" Inherits="calender" %>
  2. &nbsp; 
  3. <table style="width: 190px; height: 186px;">
  4.     <tr>
  5.         <td align="center" colspan="2" style="width: 77px; height: 33px;">
  6.             <asp:TextBox ID="txtdate" runat="server"></asp:TextBox></td>
  7.         <td style="width: 141px; height: 33px;">
  8.             <asp:Button ID="btnshow" runat="server" Text="+" /></td>
  9.     </tr>
  10.     <tr>
  11.         <td colspan="3" rowspan="2" style="height: 95px">
  12.             <asp:Calendar ID="myCalendar" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66"
  13.                 BorderWidth="1px" DayNameFormat="Short" Font-Names="Verdana" Font-Size="8pt"
  14.                 ForeColor="#663399" Height="144px" ShowGridLines="True" Width="180px" VisibleDate="2/12/2009" UseAccessibleHeader="true" DayStyle-Font-Italic="false" Font-Bold="true" SelectedDayStyle-BorderStyle="NotSet" SelectionMode="DayWeekMonth" DayStyle-Font-Bold="true" NextPrevFormat="ShortMonth" Visible="False">
  15.                 <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
  16.                 <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
  17.                 <SelectorStyle BackColor="#FFCC66" />
  18.                 <OtherMonthDayStyle ForeColor="#CC9966" />
  19.                 <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
  20.                 <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
  21.                 <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
  22.                 <DayStyle Font-Italic="True" Font-Bold="True" />
  23.             </asp:Calendar>
  24.         </td>
  25.     </tr>
  26.     <tr>
  27.     </tr>
  28. </table> 



AND THE CODE BEHIND FILE MY CODING IS (calender.ascx. vb) is as follow
through which i show the selected date in my textbox and the button helps in hiding and displaying the calender

Expand|Select|Wrap|Line Numbers
  1. Public Sub myCalendar_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles myCalendar.SelectionChanged
  2.  
  3.  
  4.  
  5.         txtdate.Text = myCalendar.SelectedDate
  6.  
  7.  
  8.     End Sub
  9.  
  10.     Protected Sub btnshow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnshow.Click
  11.         If (myCalendar.Visible = True) Then
  12.             myCalendar.Visible = False
  13.  
  14.         Else
  15.             myCalendar.Visible = True
  16.  
  17.         End If
  18.     End Sub
MY PROBLEM

how can i get the value of this calender.ascx in another page!!!

OR how to use and get the Value of t his control in other pages of my application
kindly guide me !!!!!!!!!!!!!!! !!!11
Feb 14 '09 #1
4 3112
Vkas
78 New Member
HELLO!!!!!!!!!! !!!
me using
ASP.net 2.0, language VB.net!
working tool Visula studio.Net 2005

I HAVE CREATED A simple WEB User control (calender.ascx) having
a text box ,
a button,
and a calender control
Expand|Select|Wrap|Line Numbers
  1.  <%@ Control Language="VB" AutoEventWireup="false" CodeFile="calender.ascx.vb" Inherits="calender" %>
  2.  &nbsp; 
  3.  <table style="width: 190px; height: 186px;">
  4.      <tr>
  5.         <td align="center" colspan="2" style="width: 77px; height: 33px;">
  6.              <asp:TextBox ID="txtdate" runat="server"></asp:TextBox></td>
  7.          <td style="width: 141px; height: 33px;">
  8.              <asp:Button ID="btnshow" runat="server" Text="+" /></td>
  9.      </tr>
  10.     <tr>
  11.        <td colspan="3" rowspan="2" style="height: 95px">
  12.             <asp:Calendar ID="myCalendar" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66"
  13.                 BorderWidth="1px" DayNameFormat="Short" Font-Names="Verdana" Font-Size="8pt"
  14.                 ForeColor="#663399" Height="144px" ShowGridLines="True" Width="180px" VisibleDate="2/12/2009" UseAccessibleHeader="true" DayStyle-Font-Italic="false" Font-Bold="true" SelectedDayStyle-BorderStyle="NotSet" SelectionMode="DayWeekMonth" DayStyle-Font-Bold="true" NextPrevFormat="ShortMonth" Visible="False">
  15.                 <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
  16.                 <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
  17.                 <SelectorStyle BackColor="#FFCC66" />
  18.                 <OtherMonthDayStyle ForeColor="#CC9966" />
  19.                  <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
  20.                 <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
  21.                 <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
  22.                 <DayStyle Font-Italic="True" Font-Bold="True" />
  23.             </asp:Calendar>
  24.         </td>
  25.     </tr>
  26.     <tr>
  27.     </tr>
  28. </table> 
  29.  


AND THE CODE BEHIND FILE MY CODING IS (calender.ascx. vb) is as follow
through which i show the selected date in my textbox and the button helps in hiding and displaying the calender

Expand|Select|Wrap|Line Numbers
  1.  Public Sub myCalendar_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles myCalendar.SelectionChanged
  2.  
  3.          txtdate.Text = myCalendar.SelectedDate
  4.  
  5.  
  6.      End Sub
  7.  
  8.     Protected Sub btnshow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnshow.Click
  9.          If (myCalendar.Visible = True) Then
  10.              myCalendar.Visible = False
  11.  
  12.         Else
  13.              myCalendar.Visible = True
  14.  
  15.         End If
  16.    End Sub
MY PROBLEM

how can i get the value of this calender.ascx in another page!!!

OR how to use and get the Value of t his control in other pages of my application
kindly guide me !!!!!!!!!!!!!!! !!!11
Feb 16 '09 #2
PRR
750 Recognized Expert Contributor
Take a look at : Include a User Control in an ASP.NET Web Page
and
Create an ASP.NET User Control
Also use a more appropriate title for your question...
Feb 16 '09 #3
Frinavale
9,735 Recognized Expert Moderator Expert
There are a lot of ways to pass information between web pages....for example:

You could store the selected date in Session.
When you store something in Session, that value is kept on the server and made available to every page in the web site. See the article titled: Sessions: how pass information between web pages for more information.

You could also use Cookies to pass information between web pages.
You'll have to create a cookie, store the date in it, and then access the cookie in the next page.

You could also look into using the Server.Transfer method. Make sure you fully understand how Server.Transfer works before using it because it could cause server side performance problems if not used correctly.



-Frinny
Feb 17 '09 #4
Vkas
78 New Member
ok
i will check it if could not understand then will come back soon
let me check
Feb 18 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5937
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page contains: <?php $_SESSION = ""; $_SESSION = "";
1
7780
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
5
7608
by: Raju V.K | last post by:
I am developing a web site which requires a set og unique values be transferred between pages and server many times. There fore i decided to put the values in an array so that only one reference to the array is needed ratherthan idividual reference. The situation is like this: When the page is loaded based on the user input say 6 values are created like character1="tom", character2="jerry", Character3="micky", Character4="donald",...
1
3032
by: Matt M | last post by:
Ok. So I'm passing values between web pages, as per microsoft's framework development guide (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht ml/cpconPassingServerControlValuesBetweenPages.asp) So, I have two pages, one that has some public properties and fires a Server.Transfer("receivepage.aspx"); The receivepage.aspx can then get some of the public properties I've set on the first page.
4
3137
by: rick | last post by:
Does anyone having a working example of passing values between web forms pages? I tried the example in the ms- help but I can't get by the following: To read property values from the source page in the call page. 1. Create a global instance varible that is typed to the class of the source page. the sample provided
4
2345
by: Gibs | last post by:
Hi I have two aspx pages in a frame and in the top page i am creating the controls dynamically and putting in a place holder. I have a hyperlink in this page to populate the data in the bottom aspx page. When the user clicks this hyperlink i need to populate the bottom aspx pagebased on the user imputs. So i need to pass the values from the top aspx page to bottom aspx page. how can i achieve this. Please give some ideas...
2
2006
by: VS_NET_DEV | last post by:
Hi All, There two ways of passing values between pages - 1) Context.Items.Add 2) Context.Handler (cast the page1 class etc) I know for sure #2 does not store the values between requests. How about #1. Does it store values between requests? i.e. The Context.Items. collection A)Is it like the Session variables?
1
2702
by: olduncleamos | last post by:
Hello all. With a background in ASP, I am finding the work required for passing values between pages mystifying. For various obvious reasons, I have eliminated using cookies and session to store state data. The only ASP.NET options left is to use the Server.Transfer to transfer to page 2 from page 1, and then use the context to get whatever values in page 1 from page 2. I do find this indeed a very elegant solution as now I can pass...
1
2337
by: Steve | last post by:
After a few hours of trial and error I have reached the following conclusions, can you please tell me if I am right: I have 2 aspx pages both with the same master page and I wish to pass values from one to the other. 1. The postbackurl method doesn't seem to work with master pages. If I take away the master pages it works. 2. The server.transfer method also doesn't work if I try to acess the
3
2277
by: dbuchanan | last post by:
newbie question What are the various ways that data can be passed between pages. For example; How is data about the logged in user passed to subsequent pages Thank you, Doug
0
8851
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.