|
Yes I need that code, Would you please send me code.
thanks
Naveed Kamboh
|
|
|
|
|
My current job is mostly windows forms, but I've been called to help edit the aspx pages in the web-application part of the software I'm developing, and I think I'm having some mental-adjustment issues and was hoping to get some help.
I have a page that has 2 major elements, a toolbar (with dropdown and textbox sub-elements), and a datagrid. A button on the toolbar calls a .js script that filters the datagrid based on the information entered.
What my client has asked for, and what I'm having trouble trying to figure out how to deliver, is how to retain the dropdown and textbox fields through an entire session.
I've done some searching, and my original guess of using cookies over viewstate[] seems to be the right one, and I've even found out that with IE (which my client will be using), I can set a cookie to datetime.min to have it expire at the end of the session.
My problem is that I'm having trouble trying to figure out where to assign the cookie. I've written a C# function (MakeCookie();) that declares a cookie and assigns the appropriate dropdown/textbox values to it, and I look for the cookie in the Page_Load event, but I'm unsure where (and with what syntax) I should call the MakeCookie function from the aspx.
I'm thinking that there must be some element on the body or page tag that I can use, but nothign seems to be jumping out at me.
Any ideas?
(edited to remove html to get rid of smileys)
|
|
|
|
|
session["dropdownlistvalue"] = dropdownlist.selectedvalue;
dropdownlist.selectevalue = session["dropdownlistvalue"].tostring();
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
OK, I looked that up and it seems like it would work instead of the cookies. My question is, however, is there an event that I could handle so I could set the Session[] variable as I was navigating out of the page?
|
|
|
|
|
No, but you can set the session variable everytime a menu item is selected so it's always the most recent selection, then on Page_Load load the variable.
Asp.net is all server side and there is no message sent to the server when a page closes or the user leaves it, so you can't take action. Probably your biggest adjust from windows forms to asp.net is going to be the separation between client and server.
|
|
|
|
|
I've been noticing that. Is it possible to set the session variables from the .js scripts that do the filtering (there's a button)?
|
|
|
|
|
No, the session variables never leave the server. If you want to set a session variable from the client, you have to send the information to the server and do the change on the server.
---
b { font-weight: normal; }
|
|
|
|
|
I am trying to write an ASP.NET application fo download files from an FTP site. I have a working example from MSDN that does this successful using a console application, however I would like said functionality on a ASP.NET page? Does this make sense? Can anyone help me? Thanks.
|
|
|
|
|
Hi,
i developed the E-mail application.On SEND button Click i write the following code:
MailMessage msg = new MailMessage();
msg.From = new MailAddress(TextBox1.Text);
string[] to = TextBox2.Text.Split(';');
foreach (string t in to)
{
msg.To.Add(new MailAddress(t));
}
if(TextBox3.Text!="")
{
string[] cc=TextBox3.Text.Split(';');
foreach(string c in cc)
{
msg.CC.Add(new MailAddress(c));
}
}
if (TextBox4.Text != "")
{
string[] bcc = TextBox4.Text.Split(';');
foreach (string b in bcc)
{
msg.Bcc.Add(new MailAddress(b));
}
}
msg.Subject=TextBox5.Text;
msg.Body=TextBox6.Text;
if(RadioButtonList1.SelectedValue=="HTML")
msg.IsBodyHtml=true;
else
msg.IsBodyHtml=false;
SmtpClient sc=new SmtpClient();
sc.Host="localhost";
sc.UseDefaultCredentials=true;
sc.Send(msg);
Response.Redirect("send.aspx");
But the appliaction working.I send mail to Yahoo id.When i opened but there is no message in my Inbox.What is the wrong in the above code.Why there is no message in my inbox.
Thanks In advance.
|
|
|
|
|
Hi,
For the SmtpClient object there is a property called SmtpServer, there you have to provide the IP address of the smtp server, in the yahoo mail box case you can try with URL.
Ram
|
|
|
|
|
I would like to introduce myself as ASP.Net 2.0 beginner. I face a problem when using gridview and sqldatasource.
Problem:
Initially I tried using the SQLDatasource control and Gridview with one parameter in the select query. I made that parameter as a control parameter and set the autopostback of the control. Everything worked fine.
Now I want to have multiple control parameters set for one SQLDatasource and GridView combination (It is basically a kind of search screen and the procedure for select command has so many parameters). I have created all the properties for these controls. But getting stuck with how to trigger the retrieval process. If it is one control, I used the autopostback and ASP.Net did the rest. Now that I have to manually trigger the retrieval of data and the binding on a search button click, am getting stuck.
This is an urgent requirement and Could you please help???
Thanks
Geetha
|
|
|
|
|
all you have to is put datagrid.databind(); in the code that handles the event for your search button.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi
I m using Atlas for asynchronous refreshing the page, and i have a fileupload control on the page. when i use ATLAS the opload control doesnot work > It shows FileUpload.FileName="" , though i browse a file in it.
can any one help me so that both the things works together
thnx
sandeep
|
|
|
|
|
Is it secure to place connection string in our assembly ? for example store it in a variable in our business class .or its better to place it in web.config file.
tell me why ?
|
|
|
|
|
Normally it is good to put the connection string in web.config file.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Not normally. There are valid and useful reasons for not storing it in the config file.
only two letters away from being an asset
|
|
|
|
|
The web.config file is plain text. An assembly is compiled. Which would be easier to read?
You can encrypt the config file. You can also use a tool, such as ILdasm, to view the inards of an assembly, but this is a little more difficult than simply opening a plain text xml file.
only two letters away from being an asset
|
|
|
|
|
Hi,
The connection string should be only on the web.config file.
use CipherData class so that we can encrypt it. then it will be very much secure.
Happy Coding
With Regards
Satips
|
|
|
|
|
Ofcurse its better to save in web.config. because if you deside to change it , you have not to recompile your app and upload dll file...!
|
|
|
|
|
Storing it in your business layer should be the last resort, as will require recompiling and redeploying every time you need to change it.
Other options are:
- store in web.config as clear text
- store in web.config as encrypted string (ASP.NET v2 feature)
- store encrypted in registry (current server) with registry keyname stored in web.config
It all depends on how secure you want it to be (who else has access to your web.config file?) and your deployment process (manual/automated).
.leON.
|
|
|
|
|
how to do a login form using asp.net
|
|
|
|
|
what exactly is the problem are you having.
Best Regards,
Apurva Kaushal
|
|
|
|
|
There are so many login features, and i dont know whats your especific problem, but, let me help you
if you have ASP.NET 2.0 you must to insert one login control to your aspx page
write in the property destinationpageurl the relative url to the next page (welcome.aspx could be it)
Change the Web.config
<authentication mode="Forms">
<forms loginurl="login.aspx" protection="All"
="" defaulturl="login.aspx">
This is a basic authentication concept for any website,
i hope it give you idea
Gracias
Britney
ff
|
|
|
|
|
I forget this code
At this example the login control name is logeo
Use the control event... Logeo_Authenticate
protected void Logeo_Authenticate(object sender, AuthenticateEventArgs e)
{
if ((Logeo.UserName == "a") && (Logeo.Password == "s"))
{
e.Authenticated = true;
}
}
ff
|
|
|
|
|
hi. i have a gridview and want to insert a textbox in a column of each row, and sure i did it.. but i cant get the typed text in the textboxes. i couldn't find them by id.. is there a way to do it?
|
|
|
|