|
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.
|
|
|
|
|
In your EditTemplate use a label instead of a Textbox
only two letters away from being an asset
|
|
|
|
|
This is a basic question. When would one decide to make an user control and when would you want to add the controls to the aspx page itself?
My idea was that whenever you want to add some new event to the existing control/s you would make use of the control and then add events to it. But is there any other reason why you would want to make a new control?
Also if i dont need any new events, all i do is put all the controls (that normally i would put in aspx page) in a ascx page and then just add this to my page - would i get any benefit ? like in performace?
Any help will be greatly appreciated ..
|
|
|
|
|
My biggest reason for using user controls is ...reusability.
For example, I have a "Departments" dropdown list that pulls its data from a database. If I only use this on one webform, then maybe I'll just use a dropdownlist on that one form and code to populate it. But using it on many web forms, I get a benefit from creating/coding it once as its own user control, then using the user control on each of the web forms.
|
|
|
|
|
ummm.. makes sense. But then would i get any other benefit? I could always paste the same code without any changes.
|
|
|
|
|
Yes, you could always copy/paste the same code several times.
On the other hand, if you ended up needing to make a minor change to that "Departments" dropdown, would you really want to have to make the change several times? Setting it up as a user control in the first place ensures that you only have to change it once.
|
|
|
|