|
Check this out and please reply me....
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CheckBox c1 = new CheckBox();
CheckBox c2 = new CheckBox();
c1.ID = "C1";
c2.ID = "C2";
c1.AutoPostBack = true;
c2.AutoPostBack = true;
Page.Form.Controls.Add(c1); //or Panel1.Controls.Add(c1);
Page.Form.Controls.Add(c2); //or Panel1.Controls.Add(c2);
c1.CheckedChanged += new EventHandler(c1_CheckedChanged);
}
private void c1_CheckedChanged(object sender, EventArgs e)
{
if (((CheckBox)Page.Form.FindControl("C1")).Checked) //Or Panel1.FindControl("C1")
{
((CheckBox)Page.Form.FindControl("C2")).Enabled = false;
}
else
{
((CheckBox)Page.Form.FindControl("C2")).Enabled = true ;
}
}
}
|
|
|
|
|
I have a problem.
I Fill a form and on button click event i just want to enter all values on the form, in database and form this database i take entire data and bind it to datagrid which is in other web page.
is it possible and how i do it.........
|
|
|
|
|
Ajeet mittal wrote: I have a problem
So what is the problem when you do that?
<< >>
|
|
|
|
|
Ajeet mittal wrote: Asp.Net Problem
Wow - not an ASP.NET problem ? Here in the ASP.NET forum ? ( in other words, not a good choice for a header )
Ajeet mittal wrote: is it possible and how i do it.........
Yes, it's possible. Any book on ASP.NET should give you the info you would need to at least try to do this. If, when you've done that, you're still stuck, let us know what you tried, and we'd love to help. As it stands, your question is so vague that the only way to answer it is to create a DB and a project with two pages, and write it for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi,
yes its possible n its easy. due to lack of time i m not going to write the code but if u need send me email at "kabhi__kabhi@hotmail.com" i'll send u code. anyways
do one thing,
O-O on click event of the form, save your data in the database n put an id, or value in session using "Session("DesiredValue")=txtDesiredvalue.text", which can be used to fetch data (e.g. id, name, father etc.). after words on the next page call tht value using "lblDesiredVal.Text=Session("DesiredValue")".
now use this lblDesiredval in ur query to select data from database while making data adapter.n make dataset,define datasource of the datagrid,datamember and in the last, bind id. thts it. Cake is Prepared.
Hope It Works.
Regards.
Atif Ali Bhatti.
|
|
|
|
|
I have a problem. I have two dropdown lists in my web page. named ddlApplication and ddlPermission and I have a button. I have two items in each dropdown list but when I choose second item and click on button and debug by using
these lines of code it always gives me value of first item. How should I fix this problem.
string str2 = this.ddlApplication.SelectedItem.Text;
string str3 = this.ddlPermission.SelectedItem.Text;
hahii
|
|
|
|
|
This is solution for you Check it on your system
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownList1.SelectedIndex = 0;
DropDownList2.SelectedIndex = 0;
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(DropDownList1.SelectedValue);
Response.Write(DropDownList2.SelectedValue);
}
Sujit
|
|
|
|
|
I've got a site using the default membership provider, works great. Need to store additional information like first name and last name AND have it available to all users. What's the best way (and the easiest way) to do that?
Example-
I have approximately 250 users set up on my site. Need to be able to display a full user list to all these users on demand, but rather than displaying the username, I want to show users by Last Name, First Name and Department/Location.
|
|
|
|
|
hey guys ,
i am using multiveiew control for two seperate form where i am placed textbox and button controls in the separate table.
i am allowing the users to view only one form at a time with the help of activeviewindex property,in that am using autopostback property for one of the textbox,while running the application
i got the exception error that is "javascript runtime error objects or property does not support" like that so guys i want
ur advise for the above
thanks
prabhu
coding makes me interesting in dot net
|
|
|
|
|
Hi!
I'm trying to export an ASP.NET table control to Excel. But the Excel document is empty.
My code is (tblCommission is the ASP.NET table):
Response.Clear();<br />
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");<br />
Response.Charset = "";<br />
Response.Cache.SetCacheability(HttpCacheability.NoCache);<br />
Response.ContentType = "application/vnd.xls";<br />
System.IO.StringWriter stringWrite = new System.IO.StringWriter();<br />
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);<br />
tblCommission.RenderControl(htmlWrite);<br />
Response.Write(stringWrite.ToString());<br />
Response.End();<br />
Why is the Excel document empty? Any help or info is greatly appreciated; so far Google hasn't helped me so I hope some of you can.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Not sure what this code is trying to achieve...you seem to think that RenderContol will somehow know the format of an excel document?!?!?
In order to export to excel, you'd need to hook into the excel object nodel, and iterate through the table's rows / cells collection, setting values in appropriate cells in the XLS, then send the resulting document down the wire...
(apologies if I've missed the subtlety of your code above!)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
Thanks for your answer. Well, I was working with an MS article as basis (How To Export Data in a DataGrid on an ASP . NET WebForm to Microsoft Excel[^]), but I must have misunderstood something somewhere.
I don't assume that the RenderControl knows the Excel format, I simply assume that I extract the HTML and get Excel to show it in a workbook.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Hi all.
I need help creating discussion forum threads as the ones here in code project.
A set of questions will be posted on a site. A user will login and post a reply to the question and submit it. The reply should immediately show as a branch off from the question. In turn, replies can also have sub replies and should show as a sub branch from the previous reply.
I need help with this in c#(asp.net)please. Any URL's,documentation,source code,etc will be of great help.
thanks
Marquin ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Search RiversideInternetForum project here...that's great in ASP.NET,C#
<< >>
|
|
|
|
|
i wanna know how to use open file dialog control in C# aps.net web application.as i have to save the downloading attachment file on my system through my application. i want help in C# coding instead Asp.I m using Vstudio 2003
Thanx
|
|
|
|
|
Do you mean you want to show open/save dialog in web application as windows form application??
<< >>
|
|
|
|
|
Ya exactly i wanted to do that in the same manner ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
You can manually trigger Save Dialog. You can rather stream the file and set the Content-Disposition header.
|
|
|
|
|
Hi All,
What is cmd.Addinparameter() which taking four parameters in .Net 2005.If anyone knows abt this pls explain me.what are the four parameter.
Thanks.
|
|
|
|
|
siddisagar wrote: cmd.Addinparameter()
What is cmd.Addinparameter ?
Best Regards,
Apurva Kaushal
|
|
|
|
|
Generally we use cmd.parameters in 2003 version of dotnet ,But i saw cmd.addinparameter in 2005 version it is taking 4 parameters .so that i am asking.I need what parameters it will take actually?
Thanks.
|
|
|
|
|
Lazy....VERY LAZY.....[^]
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
I have created few pages using DotNetNuke. These are just Home , ABout Us & Contact us.
Now i want to deploye these pages on a server so that i can view as a website.?
How should i do it?
Any one please help me..its very urgent.
KHATRI
|
|
|
|
|
Dear All,
I am using a multiview control , with three views in it. I can switch the views through server side by simply setting the property ActiveViewIndex. But I want to change views on client side. Please help me in this regard.
vijaykrishna v
|
|
|
|
|
Certainly this is not possible as these are server controls and you need to do a post back at the server change the view.
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|