|
|
i need to send the textbox value from the "second" page to "first" page..... (i.e, TEXTBOX1 of "first" page is to be get filled by TEXTBOX2 of "second" page values, while user click a button in "second" page)
I am using ASP.NET with C# (.net 2003, 1.1 framework)
Thanks in advance - john
|
|
|
|
|
use Session Variable or QueryString
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Yes my friend.
Using querystring or session we can do it.
but what the thing is, when i click the button in "second" page, at once the textbox2 value from "second"
page is to get SET to the textbox1 of "first" page.
does we can achieve it by using query string or session.?
if so, HOW?
|
|
|
|
|
John Sundar wrote: but what the thing is, when i click the button in "second" page, at once the textbox2 value from "second"
page is to get SET to the textbox1 of "first" page.
What does it mean ?
when click on button on second page you want to back on first page ???
or both page will open ????
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
thanks for your reply Abhijit Jana.
i have two webform "parent" and "child".
in "parent" webform : one textbox(parent_textbox) and one button(parent_button).
in "child" webform : there are one textbox(child_textbox) and one button(child button).
Process flow:
when user click the "parent_button", the "child" webform should open.
Then user will input some text in "child_textbox" and when user press "child_button", the "child" webform should close and the "child_textbox" value should set to the "parent_textbox".
How can i achieve it?
EXAMPLE : in GMAIL, to attach a file, when user clicks the attach button, it open the browse window. when user select the file, the browse window will close and the corresponding path will set to the textbox.
-JOHN
|
|
|
|
|
thanks for your reply Abhijit Jana.
i have two webform "parent" and "child".
in "parent" webform : one textbox(parent_textbox) and one button(parent_button).
in "child" webform : there are one textbox(child_textbox) and one button(child button).
Process flow:
when user click the "parent_button", the "child" webform should open.
Then user will input some text in "child_textbox" and when user press "child_button", the "child" webform should close and the "child_textbox" value should set to the "parent_textbox".
How can i achieve it?
EXAMPLE : in GMAIL, to attach a file, when user clicks the attach button, it open the browse window. when user select the file, the browse window will close and the corresponding path will set to the textbox.
-JOHN.....
|
|
|
|
|
John Sundar wrote: URGENT! - Passing value from one page to another?
Mmmm.. Read this[^]. You will get the solutions. Also buy some books to learn how ASP.NET works
|
|
|
|
|
Please don't ask the same question day after day. If you don't understand the answers you got, ask again ( that is, ask the person who answered you, on the same thread, not a new one ). If you still can't work it out, then realise that the problem is with you - buy a book, do a course, bring yourself to a level of being able to understand the answers.
Like I said the other day, the easiest way is to make both pages controls on the one page, and let viewstate store the values and your main page pass them between the controls as they are shown and hidden.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I know you don't care about the 1 voters, but I hate seeing a decent response in grey.. voted 5 to even the score!
|
|
|
|
|
When I click a link, a grid should be visible. Its similar to tab controls but in tab controls the tabs will be horizontal, but I need it to be vertical. Like a tree view, when I click, Link1, underneath, a control will pop up which will have a grid. When I click Link2, another control should open up.
Can you suggest me which control I can use for this? I have tried to describe but if not clear, I can try explaining again.
Thanks
|
|
|
|
|
There's no control for this, but you can just show/hide your grids when the links are clicked.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi!
what's the difference between using a static class (or class with singleton pattern) and holding non-static instance in Session.
my question is mostly about application performance and resource usability, but besides that is there any other difference? creation time, dispose time?!
thanks for any help!
Seishin
life is study!!!
|
|
|
|
|
There is a big difference that you have to consider first of all, and that is that the session variable is user specific, but a static variable is not.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi there,
I have been looking into implementing Asynchronous programming model within my webservice and my asp.net web form. I have found a few good MSDN articles, [^], to achieve this but there is one thing I do not quite follow. My webservice code is as listed below.
I add all the relevant code including a web reference to my HelloWorldWebService in my asp.net web form to utilise PageAsyncTask functionality. One thing I have noticed is that when I create an instance of the HelloWorldWebService web service, it does not display the BeginHelloWorldProcedure and EndHelloWorldProcedure methods and the only asynchronous method HelloWorldProcedureAsync is displayed
My questions are:
1) why am not seeing BeginHelloWorldProcedure and EndHelloWorldProcedure methods ?
2)If I am supposed to use HelloWorldProcedureAsync method how does this supply the IAsyncResult which is the output of BeginEventHandlder part of the input of PageAsyncTask
Any help will be appreciated.
thanks.
<br />
[WebService]<br />
public class HelloWorldWebService : System.Web.Services.WebService<br />
{<br />
public delegate string HelloWorldAsyncStub();<br />
<br />
<br />
public string HelloWorldProcedure()<br />
{<br />
return "HelloWorld";<br />
}<br />
<br />
public class MyState<br />
{<br />
public object previousState;<br />
public HelloWorldAsyncStub helloworldStubStub;<br />
}<br />
<br />
[System.Web.Services.WebMethod]<br />
public IAsyncResult BeginHelloWorldProcedure(AsyncCallback cb, object s)<br />
{<br />
HelloWorldAsyncStub stub = new HelloWorldAsyncStub(HelloWorldProcedure);<br />
<br />
MyState ms = new MyState();<br />
ms.previousState = s;<br />
ms.helloworldStubStub = stub;<br />
return stub.BeginInvoke(cb, ms);<br />
}<br />
<br />
[System.Web.Services.WebMethod]<br />
public string EndHelloWorldProcedure(IAsyncResult call)<br />
{<br />
MyState ms = (MyState)call.AsyncState;<br />
return ms.helloworldStubStub.EndInvoke(call);<br />
}<br />
}<br />
|
|
|
|
|
Hi Ekynox,
ekynox wrote: 1) why am not seeing BeginHelloWorldProcedure and EndHelloWorldProcedure methods ?
I used the above code created a WebSevice in VB (as Language does not matter). And I am able to see the Begin and End of the Web method in my website where I implemented.
Could you please tell me how you implemented it in your application?
|
|
|
|
|
Hi there,
Thanks for the response. I actually worked out why I was not seeing the BeginXXX/EndXXX methods. When I complied the code under VS 2005, the compiler will automatically generate the BeginXXX/EndXXX methods of each web method found in your webservice. However, if you use VS 2008 .NET3.5 based web service the BeginXXX/EndXXX methods for each web method is not generated even if you explicitly state your BeginXXX/EndXXX methods it still wont be shown under VS 2008 .NET3.5.
It would be interesting to findout why under VS 2008 and .NET 3.5 does this happen.
In order to work around this I have decided not to bother with PageAsyncTask and just use the Async version of my web method.
cheers
|
|
|
|
|
I have searched, with no success, for the answer to my problem. I want to dynamically create a linkbutton and programatically set the command to fire when the button is clicked. I can create the button, but the only event that seems to fire is the Page_Load. A simple example is below:
---- File: Test1.aspx ----
<code>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test1.aspx.cs" Inherits="ReportCard.Test1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
</form>
</body>
</html>
</code>
---- File: Test1.aspx.cs ----
<code>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NLog;
using System.Text;
namespace ReportCard
{
public partial class Test1 : System.Web.UI.Page
{
public static Logger logger = LogManager.GetCurrentClassLogger();
protected void Page_Load(object sender, EventArgs e)
{
logger.Info("Page_Load: Postback: {0}", Page.IsPostBack.ToString());
}
protected void Button1_Click(object sender, EventArgs e)
{
logger.Info("Button1_Click");
Table table = new Table();
int i = 1;
TableRow tr = new TableRow();
TableCell tdSysCode = new TableCell();
tdSysCode.CssClass = "tdSysCode";
tdSysCode.Text = string.Format("{0:000}", i);
TableCell tdSysname = new TableCell();
tdSysname.CssClass = "tdSysname";
LinkButton lb = new LinkButton();
lb.CommandName = "lbViewSystem_Click";
lb.CommandArgument = i.ToString();
lb.Command += new CommandEventHandler(lbViewSystem_Click);
lb.Text = string.Format("System {0:000}", i);
tdSysname.Controls.Add(lb);
tr.Cells.Add(tdSysCode);
tr.Cells.Add(tdSysname);
table.Rows.Add(tr);
table.ID = "tblSystemResults";
table.CellPadding = 0;
table.CellSpacing = 0;
TableHeaderRow thrHeader = new TableHeaderRow();
TableHeaderCell thSystemCode = new TableHeaderCell();
thSystemCode.Text = "System Code";
TableHeaderCell thSystemName = new TableHeaderCell();
thSystemName.Text = "SystemName";
thrHeader.Cells.Add(thSystemCode);
thrHeader.Cells.Add(thSystemName);
table.Rows.AddAt(0, thrHeader);
PlaceHolder1.Controls.Add(table);
}
protected void lbViewSystem_Click(object sender, CommandEventArgs e)
{
logger.Info("lbViewSystem_Click");
Literal1.Text = string.Format("Argument = {0} at {1}", e.CommandArgument, DateTime.Now.ToString("MM.dd.yyyy HHmmss"));
}
}
}
</code>
On initial load, click the button, display the link button, then click the link button. You should see a message, but nothing happens.
I've read about creating the link button in the page_load (or on_init) method, but haven't had any success with that either.
Any tips are appreciated.
--G
|
|
|
|
|
Any dynamically created button must be created before page load ( usually in loadviewstate, before viewstate is loaded ) in order for it's events to fire, because the button has to exist when viewstate is restored, in order for it's events to hook up properly.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian,
I must be really dense here -- I've tried overriding the OnInit and/or the LoadViewState, and recreating the object in every Page_Load, but still no success.
Currently, I have a member variable, LinkButton lb. I have a method, CreateButton, that creates the button, sets the properties, and creates the CommandEventHandler. I call this method in various places, but no luck. What am I missing?
<br />
protected LinkButton lb = null;<br />
protected override void LoadViewState(object savedState)<br />
{<br />
CreateButton();<br />
base.LoadViewState(savedState);<br />
}<br />
<br />
protected void CreateButton()<br />
{<br />
if (null == lb)<br />
{<br />
lb = new LinkButton();<br />
}<br />
lb.ID = "lbTest001";<br />
lb.CommandName = "lbViewSystem_Click";<br />
lb.CommandArgument = "1";<br />
lb.Command += new CommandEventHandler(lbViewSystem_Click);<br />
lb.Text = string.Format("System {0:000}", 1);<br />
}<br />
<br />
protected void lbViewSystem_Click(object sender, CommandEventArgs e)<br />
{<br />
logger.Info("lbViewSystem_Click");<br />
Literal1.Text = string.Format("Argument = {0} at {1}", e.CommandArgument, DateTime.Now.ToString("MM.dd.yyyy HHmmss"));<br />
}<br />
Again, any help is very much appreciated.
--G
|
|
|
|
|
I finally got this to work -- not only did I have to recreate the buttons in the OnInit, but I also had to add the buttons to a control on the page. Looking back, that makes some sense.
Thanks for the pointer -- I don't think I would have placed it in the OnInit.
--G
|
|
|
|
|
What is the script line, if any, to set the arguments for the expiration of a virtual dirctory, as you create the VD programmatically, in .net?
|
|
|
|
|
hi can anyone help give me advise on how i can link two things together. i have created a slideshow and i have written some javascript. the slide show is of a series of images and the javascipt performs a series of text appearing on screen which runs when the user clicks a button. however, what i would like to do is combine the two so that they run at the same time. does anyone know how i can combine these to work using just one button click?
in my slide show i know how to write text along with the slides, but i want the text to appear in a way which isnt static and that is why i have done the javascript bit.
i hope this makes sense, any examples or adivce on how i can do this would be much appreciated hope all this makes sense, if it doesnt let me know and i will try to explain better
|
|
|
|
|
How is the slideshow being displayed? You can use a timer server control or setInterval from JavaScript
only two letters away from being an asset
|
|
|
|
|
hi, i have used javascript to display my text and the ajax slideshow control to display the pictures, i want to be able to display the pictures and text in-sync with eachother which is why i am trying to combine the two together with just one click of a button. any help would be much appreciated as to hw i can do this. do you have any examples?
thank you
|
|
|
|