|
How do you mean in normal windows based forms? You'll need to hold some record somewhere of the already used codes and write a bit of logic to create your code...
|
|
|
|
|
im using ASP.Net 2.0, pretty new to it so not quite sure. im not using the sqldatasource controls. im binding a gridview with a dataset. so id have to first check the dataset? im not to sure. but i want to know if theres an example to generate the ID i was talking about.
|
|
|
|
|
hai
i heard something about digital data board. will anybody able to give any explanation about this.
actually in one of my project i want to dosomething like this. i would like to display the clients monitor in another client browser. its something like remote desktop in XP. anybody knew anything about this.? pls reply. it will be a great help for me. thanks in advance.
|
|
|
|
|
Hi,
how we can generate wizard steps automatically base on variable
for example
when page load check the value of the variable and then crate wizard steps equal to the value of variable and then set the property of each step.
Thanks a ot
|
|
|
|
|
Here is a simple example of programmatically creating wizard steps. The trick is to create the steps in the PreInit event of the page.
<%@ Page Language="C#" %>
<script runat="server">
void Page_PreInit(object o, EventArgs e)
{
string[] data = new string[3] {"What is your name? "
,"What is your quest? "
,"What is your favorite color? "
};
for (int i=0; i<data.Length; i++)
{
WizardStep theStep = new WizardStep();
theStep.ID = "Step" + i.ToString();
theStep.Title = "Step " + i.ToString();
theStep.StepType = WizardStepType.Auto;
Label label1 = new Label();
label1.Text = "<br />" + data[i] + "<br />";
theStep.Controls.Add(label1);
TextBox tb1 = new TextBox();
tb1.ID = "txt" + i.ToString();
theStep.Controls.Add(tb1);
wiz1.WizardSteps.Add(theStep);
}
wiz1.ActiveStepIndex=0;
}
</script>
<html>
<head></head>
<body>
<form runat="server">
<h3>Programmatically Adding Steps to Wizard</h3>
<hr />
<asp:Wizard id="wiz1" runat="server"
DisplaySideBar="true"
HeaderText="Wiz1"
BorderWidth="1" BorderColor="#CCCCCC" BorderStyle="Solid"
StepNextButtonText=" Next >> "
StepPreviousButtonText=" << Previous "
FinishCompleteButtonText=" Done! "
CellPadding="4"
>
<HeaderStyle BackColor="#999999"
ForeColor="#FFFFFF"
HorizontalAlign="center"
Font-Size="12" Font-Bold="True"
/>
<SideBarStyle BackColor="#EFEFEF"
/>
</asp:Wizard>
<hr />
</form>
</body>
</html>
|
|
|
|
|
Hi,
Pls let me know, is there any projects to develop in asp.net , c#
how and where i need to check in codeproject
Regards
muralidhar
Muralidhar
|
|
|
|
|
Hello
I got exception System.nullReferenceException in NUnit, when i use database initialization code.
I am using ASP.Net 2.0 with C#.
There is no error in Code. The same code in VS 2003 has been successfully test by NUNIT.
Plz help me.
|
|
|
|
|
hi,
i m developing a web application using asp.net c#, How to stop saveing my web page on client side.
For example as in yahoomail, when you go back in history of web browser only the login page is there.
please sent me code or online help referance
thanks in advance
please help me
shaleen
|
|
|
|
|
Do you want the history to be cleared or something else?
Best Regards,
Apurva Kaushal
|
|
|
|
|
hi
yes,I want to cleared the history page of my web application and only the login page can be avalable in the history and no other page is save in the browser history
shaleen
|
|
|
|
|
To see the history object in javascript you can have a look at these link:
http://www.irt.org/script/history.htm
and also you can have a look to :
Response.Cache.SetCacheability
through this also you can prevent the page from being cached.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Sir,
Can i programically set the focus on the textbox.Can i write the code in code behind file in vb.net.
PLease Help.
|
|
|
|
|
Yes you can you can use javascript to set the focus and yes that javascript you can write in code behind also. Do you want to do it at load of the page or some other time?
Best Regards,
Apurva Kaushal
|
|
|
|
|
Sir,
At page load .Can u help me by sending some code.
Please help.
|
|
|
|
|
this is the codebehind part:
string str = "<script language='javascript'>";<br />
str += "function Focu(){";<br />
str += "document.getElementById('TextBox3').focus();}<";<br />
str += "/";<br />
str += "script>";<br />
if(!IsStartupScriptRegistered("Test"))<br />
{<br />
Page.RegisterStartupScript("Test",str);<br />
}
And this "Focu" function you have to call in the onload event of the body tag.
Best Regards,
Apurva Kaushal
|
|
|
|
|
In code behind file include this code.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
setfocus(textboxid,me)
End sub
Private Sub setFocus(ByVal ctrl As Control, ByVal page As Page)
Dim s As String = "<SCRIPT language='javascript'>document.getElementById('" + ctrl.ID + "').focus() </SCRIPT>"
page.RegisterStartupScript("focus", s)
End Sub
Regards,
Raghu
|
|
|
|
|
Hi,
I have a gridview with Edit.After updating gridview again i binddata().
protected void GridView1_RowUpdating(Object sender, GridViewUpdateEventArgs e)
{
int qty;
int p;
int c;
qty = Convert.ToInt32(((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox1")).Text);
Label t = (Label)GridView1.Rows[e.RowIndex].FindControl("Label4");
c = Convert.ToInt32(t.Text);
//c = Convert.ToInt32(((TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox4")).Text);
p = Convert.ToInt32(((Label)GridView1.Rows[e.RowIndex].FindControl("Label5")).Text);
shopcart.updatecartitems(c, p, qty);
binddata();
For BindData() code is
void binddata()
{
int i = Convert.ToInt32(Session["cartid"]);
DataSet ds = shopcart.getitemsfromcart(i);
GridView1.DataSource = ds;
GridView1.DataBind();
}
after updating even iam binding new data to gridview the row is still displaying textbox(with empty)In database the row is updated.but gridview binding not displaying updated data.Gridview displaying textbox with empty.
After editing any command is there like endedit.
Please help me.
Thanks in advance
|
|
|
|
|
I had this problem once before and the way I handled it was to refresh the page after updating the row using Response.Redirect() then add the data binding code in the PageLoad event handler.
Mohamed El Gohary
|
|
|
|
|
Hi.. Good Day!
I'm using asp.net vb 1.1 ang SQL Server2000 to develop the page. My problem is i have 2 textbox for user to key in the date. I will use this 2 date to search data in database. How the code looks like if i need to search data from one date till other date provided by the user?
Anyone can guide me to solve this problem? Thanks..
Best Regards,
Pei Sun
|
|
|
|
|
Hi there,
just using SQL query,... something like SELECT ... FROM ... WHERE datefield between 'date1' and 'date2' . You can read more in SQL Book online
<< >>
|
|
|
|
|
Hi... Good Day!!
I have a database table which use as a temporary table to store the edited and new added data. I wish to flush away this table data when i finish printing out the data in this table.
My question is is it possible to flush away the data in the temporary table in database. If yes, how is the coding looks like? Anyone can give me a guide? Thanks....
Best Regards,
Pei Sun
|
|
|
|
|
Iam not sure I got your clue...
If you use DataTable to store the data, so to let flush away, just clear all...
<< >>
|
|
|
|
|
Thanks. I'm not using the data table to store the data. Is that possible in the .aspx page, i use the commmand to create a temporary table to store the new data and then clear it when the data is not usable already? Can you give me some guide? Thanks
Best Regards,
Pei Sun
|
|
|
|
|
Hi
ypsyong wrote: i use the commmand to create a temporary table to store the new data and then clear it when the data is not usable already
If so, you just use the SQL query DROP TABLE... to drop the table or just use DELETE FROM... query to delete all records
<< >>
|
|
|
|
|
Hi,
I have a gridview(Shopping Cart) with columns Product Name,Price,Qty and edit Facility.I handle the events GridView_RowEdititng,Gridview_Rowupdating.
when user clicks on Edit link,he can change only QTY field.But when user click on Edit For all fields textboxes are displaying.I want textbox is displayed for QTY field only.
How can this achived.
Thanks in advance.
|
|
|
|