|
That's a great tool. Thanks for the recommendation!
|
|
|
|
|
I want to select one Row from a datagrid so I create a textBbox(txtname) and Button for the user to write the name in textBox and By the click of the button it select the corresponding row. But it's not selecting the row neighther I'm getting any mistake message I'm I missng some thing? I wrote the code on Button_Click sqlCommand as follows:
SqlCommand myCommand = new SqlCommand("SELECT * from employee where fullname Like %+txtname+%" ,con);
Thank you.
|
|
|
|
|
Of course you are getting an error message, that query is not possible to run. Do you have code for catching and ignoring the error?
You haven't shown the code for running the query. Do you run it at all?
You can not use controls from the ASP.NET code in the SQL query, the database can not access the controls. Add a parameter in the query and add a parameter object to the command object with the value from the control.
---
Year happy = new Year(2007);
|
|
|
|
|
thanks Guffa,
I have the code for cthin the Error. actually the whole code is here below.
try
{
con.Open();
SqlCommand myCommand = new SqlCommand("SELECT * from employee where fullname Like %+txtname+%" ,con);
SqlDataAdapter myAdapter=new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds,"isp_email.staff");
con.Open();
myCommand.ExecuteNonQuery();
dgupdate.DataSource=ds;
dgupdate.DataBind();
con.Close();
}
catch(Exception err)
{
Console.WriteLine(err.Message);
}
finally
{
con.Close();
}
Thanks
|
|
|
|
|
Dear CPians,
I is there a way to use OutputCache in WebControls?
It is very easy to use it in UserControls, But what happens with WebControls?
Am I missing something important?
Thanking you in advance.
|
|
|
|
|
Basically, you can only use the OutputCache directive with a content element like the web page or web user control, and at runtime the ASP.NET parser will process this directive to decide if it should initialize the element from scratch or simply get the output markup from cache. For the custom control, you cannot apply this directive and if you want to support caching for custom controls, you'll need to think of other solutions. For example, you simply use a web user control as a container for your webcontrol.
|
|
|
|
|
how to increase the speed of image in asp.net.
|
|
|
|
|
Im not sure what your mean....Do you mean that you just show the image in thumnail...then show the full size of image if user want to...???
<< >>
|
|
|
|
|
Load smaller images.
|
|
|
|
|
Can anyone help with this?
I have an aspx page with 2 divs both marked to run at server.
<div id="div1" runat="server">
this is div 1
</div>
<div id="div2" runat="server">
this is div 2
</div>
In the page load, I dynamically add a clientside onclick postback to the divs like so:
if (!IsPostBack)
{
div1.Attributes.Add("onclick",
Page.ClientScript.GetPostBackClientHyperlink(div1, ""));
div2.Attributes.Add("onclick",
Page.ClientScript.GetPostBackClientHyperlink(div2, ""));
}
When I click on the div it postbacks ok, but the question is, how do I identify on the server which div sent the postback? (or have I got the wrong end of the stick)?
Cheers
ChrisB
|
|
|
|
|
Hi Chris:
Here is just a suggestion...Before do postback, you store div id into a hidden field...then you can parse this at server side to know which div causes post back...
Hope you get the clue...
<< >>
|
|
|
|
|
At the server side, you simply check on the Request.Form["__EVENTTARGET"] entry to see which object causes the postback, for example if you click the div 1 then the value should be "div1". In addition, you might think about building a custom div control with a custom event, say Click, and you can easily determine which div causing the postback using the sender object of the Click event handler.
|
|
|
|
|
|
Hello I have a gridview and one field is "stock" this field has edititemtemplate and this has a regularexpression validator, I need information how custumize this. I need controller that the user only used number and not letters.
My level is very poor, please any solution easy.
Thaks very much.
|
|
|
|
|
Try and write your Validation code in the onValidating event of cell such that if it doesnt validates, cancel (e.cancel=true) the effect so that cursor remains within the same cell.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Ok Thanks very much but I find other solution more easy, I used the comparevalidation object and put in type "double" this solution is simple and perfect, now only permited number and dot.
This information I found in this foro. Thanks.
My little problem is that I not understand the format of custom validation expression and I not find information about this.
Thanks very much.
|
|
|
|
|
gonmor wrote: My little problem is that I not understand the format of custom validation expression and I not find information about this.
It's not that hard, just give the Expresso[^] a try with the 30 mins tutotial[^].
|
|
|
|
|
ur problem is not clear still hv a look if this cn help u
1. create EditItemTemplate
2. put a txt box named "Stock" or whtever
3. put a <asp:regularexpression> there and put ValidationExpression="^\d+$" it will allow only numbers.
|
|
|
|
|
Oh thanks very much is a good program, I am sure that I will give good use him.
|
|
|
|
|
i am interested to work on website which have facility to send message on email address and also this message send on a mobile no, whats are the additional software which i have to install. i am interested to develop ASP.NET using C# thanks.
|
|
|
|
|
Hi there:
You might take a look at this article ...Send SMS
Hope you get the idea...
<< >>
|
|
|
|
|
in my project if i refresh any page then home page will be coming what i have to do for current page
|
|
|
|
|
Make sure that the link in the address bar points to your current page. If you have done something like a Server.Transfer to get to the current page, then the link will show the old value.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
May be you are using iframe in your pages, which is having the Home page set as default page. just check it out.
Srini
|
|
|
|
|
Hi all,
Could someone plz help ... I'm using ASP in dreamweaver 8 (not vb), I'm trying to split the var aList, but I'm getting the following errers:
aList -> 1,2,3 // Example of how the variable would look like.
Microsoft JScript runtime error '800a138f'
Object expected
logonAcces.asp, line 36
33 var listArray;
34 var aList = rs.Fields.Item("ACTIONLIST").Value;
35 Response.Write("aList -> "+aList);
36 listArray = split(aList,",");
37 Response.Write("listArray -> "+listArray);
Thank you in advance....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|