|
You can use button onclick="javascript:history.go(-1)" to work the same way as your back button.
But I personally suggest not to rely too much on history object. If user deletes cache.. back will not work. Rather implement back button to point to the location just prior to it so that it calls the proper page rather than using Cached page of the browser.
|
|
|
|
|
Hi...
I have textbox for password and textmode = password. when the page is posted back value goes and textbox remains empty. i want to retrieve this value on postback and would set this value again to textbox.
please guide me
thanks,
By:
Hemant Thaker
|
|
|
|
|
TBOMK, you can't set the text in a password field
only two letters away from being an asset
|
|
|
|
|
There's a very nice extension of a text box in an article right here on CP that allows for this. As the article points out, it is usually not advisable to set the text in a password box, but the control is a useful arrow to have in your quiver for those times when it is not.
|
|
|
|
|
Hi Hemant,
Why you wanna retain password field on paostback , obviously you can store it in a hidden control ,
but the password field is never supposed to work in this way
|
|
|
|
|
Nishant Singh wrote: Why you wanna retain password field on paostback ,
Although the advice is good, and well meant, the idea that any of us can tell the client, "you can't have a password input that retains its value," is far-fetched. We are supposed to solve the client's problems, not create new ones and if they can imagine it, then we should be able to program it.
Of course the above is my opinion and worth every penny you paid for it.
|
|
|
|
|
Hi to all,
I want to add sms service in my application, I have API of sms service, but i dont know how implement it. please help me!
Farogh Haider
Web developer
|
|
|
|
|
API or service?
There are services available that let you send messages.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
farogh123 wrote: I have API of sms service, but i dont know how implement it.
So why are you asking us and not them ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Farida , You can implement it using the Value First SMS API like the following code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SMS.aspx.cs" Inherits="SMS.SMS" ValidateRequest="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>SMS Pace Client API Version 1.2</title>
</head>
<body>
<form action="http://api.myvaluefirst.com/psms/servlet/psms.Eservice2" method="post" runat="server">
<textarea name="data" cols="60" rows="16">
="1.0"="ISO-8859-1"
<!DOCTYPE MESSAGE SYSTEM "http://127.0.0.1:80/psms/dtd/messagev12.dtd">
<MESSAGE VER="1.2">
<USER USERNAME="" PASSWORD=""/>
<SMS UDH="0" CODING="1" TEXT="" PROPERTY="0" ID="1">
<ADDRESS FROM="ASPNetApp" TO="919831012345" SEQ="1" TAG="some clientside random data"/>
</SMS>
</MESSAGE>
</textarea>
<INPUT TYPE="SUBMIT" name="action" value="send"/>
</form>
</body>
</html>
|
|
|
|
|
hi all.,
this is how i inserted images into sql.. and displayed thumbnail in image control..
byte[] img = new byte[FileUpload1.PostedFile.ContentLength];
HttpPostedFile postfile = FileUpload1.PostedFile;
postfile.InputStream.Read(img, 0, (int)FileUpload1.PostedFile.ContentLength);
System.Drawing.Image img12 = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream);
SqlCommand cmd = new SqlCommand("insert into image11 (type,name,length,byte) values(@type,@name,@length,@byte)", cnn);
cmd.Parameters.Add("@type", SqlDbType.VarChar).Value = FileUpload1.PostedFile.ContentType;
cmd.Parameters.Add("@name", SqlDbType.VarChar).Value = FileUpload1.PostedFile.FileName;
cmd.Parameters.Add("@length", SqlDbType.VarChar).Value = FileUpload1.PostedFile.ContentLength;
cmd.Parameters.Add("@byte", SqlDbType.Image, img.Length).Value = img;
cnn.Open();
cmd.ExecuteNonQuery();
cnn.Close();
DataTable dtTemp = new DataTable("TempImage");
dtTemp.Columns.Add("Image", System.Type.GetType("System.Byte[]"));
DataRow dr = dtTemp.NewRow();
dr[0] = img;
dtTemp.Rows.Add(dr);
Session["dt"] = dtTemp;
Image1.ImageUrl = "de.aspx?id=0";
im trying get image to a image control
but im unable to retrive that image from database i tried using handler.ashx
|
|
|
|
|
madhukk wrote: im trying get image to a image control
Did You write code in
madhukk wrote: Image1.ImageUrl = "de.aspx?id=0";
To show the image..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi Madhukk,
Please visit this site.
http://www.aspsnippets.com/post/2009/02/21/Display-Images-from-Database-using-ASPNet.aspx
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
In my application.I have used a gridview and in the header of a particular column of that gridview I have used checkbox.In the checkchanged event of the checkbox some database query executes.It is working but the problem is after the page post the checkbox gets unchecked.But I want that the checkbox remain checked.How can it be achieved.
|
|
|
|
|
Are you re-initializing the checkbox when page is posted back...
You should block the initialization inside
if(!IsPostBack) block .
|
|
|
|
|
No i am not initialising it.
And i am also forcefully checked the checkbox before databind method.But still it is not working.
|
|
|
|
|
Hi,
I'm using asp.net2.0
And using MS Application Blocks for DAL.
Now i'm aware about the performance of the application.
Is that DAL is suitable with asp.net 2.0..
Or any dis advatages?
plz let me know
With regrads
|
|
|
|
|
DAL means Data Layer.
We use this just to separate the Data blocks from presentation layer, so that data manipulation could be made easily manageable.
AFAIK, It will not involve any performance issue.
|
|
|
|
|
Hi all,
I am designing my program like this. I am having a text box, button and a grid view on my page. When i entered some value in text box and click on button the value is binding to grid view. In the grid view i am having only one field as Name and option as select. When i click on select i am displaying the corresponding user in the text box. What i need is if i edit the text on the text box and click on the same button again the value should replace the old one.
Example
TextBox -----------
Button
Gridview
Name
Dora select
Xyz Select
When i click on select at xyz i am displaying it in text box. If i would like to replace it with some name like ABC what to do.. Please help me..
|
|
|
|
|
|
Yes ... It is trivial... First of all let me know are you storing the data into database ?
If the data is in the database, just update the value when user clicks on the button after updating the data, and rebind the Gridview to reflect the update.
|
|
|
|
|
How can I show additional button in a gridview cell based on another cell value.I am using asp.net and c#.
I have ON or OFF values in a GridView cell. Based on this value I want to show a button (opposite Toggle (OFF/On) correspondingly) in another cell.
This is my code.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.Cells[2].Text== "0")
e.Row.Cells[2].Text = "OFF";
else
e.Row.Cells[2].Text = "ON";
}
please help.
Thank You
|
|
|
|
|
Are you looking for UnBound TemplateField ?
Simply add
<asp:TemplateField HeaderText="Mode">
<ItemTemplate>
<asp:Button runat="server"
Text="<%!Convert.ToBoolean(Eval("Toggle")) %>" CommandName="ToggleClick"
CommandArgument='<%#Eval("Toggle") %>/>
</ItemTemplate>
</asp:TemplateField>
and use OnRowCommand to handle this event.
|
|
|
|
|
thanks for the reply,
but there is something wrong with this code.
Can u recheck it plz?
Thank You
|
|
|
|
|
Yes.. Actually I have written this directly.. Not tried out.... Can you let me know what error you are getting ... ?
Well, Eval("field") should be changed with your valid database field ??
Also change the fieldnames according to the datasource you bound to.
|
|
|
|