|
View State is enabled for the same page. that is if post back to the same page then the values are retained . But if you go to another page you can create hidden fields in that page and then post that page to your page. then you can get the values by request.form(name of the hidden field).
for eg there is a textbox in form a . if you post to form b then create a hidden
field in form b and get its value in it. Then again post form b to form a then the values of th text box can be extracted by
textbox1.text=request.form("hidden field");
|
|
|
|
|
ViewState is a mechanism to remember control data during postbacks to the same page. It is not a state management tool for retaining data as you navigate a site, so it isn't going to be helpful to you in this context.
What you'll want to look into is programatically collecting that data that you'd like to maintain and saving it for use during the user's session. There really isn't a built in mechanism to handle this task, you will need to program for it. In general, this is referred to as "Session State".
A Google search[^] returns plenty of hits to sort through. I'd recommend taking a look at:- This[^] article over at Informit on ASP.NET session state beginnings
- This[^] article at Informit on more advanced session management
Hope that helps.
--Jesse
|
|
|
|
|
Hi,
I have a datagrid and i am using datatable to bind it. There are 5 textboxs .Once i fill the textbox, i click a button ADD and the data from textboxs are added to datagrid. So i use datatable. Problem is when the Page is loaded, datagrid does not appear even if there is no data. Datagrid is visible only when we bind to datatable. Is it possible to display datagrid without any rows showing "NO Data" and display rows when we click ADD button.
hope U got my question.
|
|
|
|
|
use datagrid headers this may help u.
|
|
|
|
|
Datagrid Headers are displayed only when we bind to datasource. Is it possible to display datagrid headers without setting the datasource.
|
|
|
|
|
public sub fillgrid()
dim dt as new datatable
dim ds as new dataset
dim dr as datarow
dim i as integer
dim con as new sqlconnection("conn")
dim da as new sqldataadapter("select * from TableName",con)
da.fill(ds)
if ds.tables(0).rows.count>0
dt.coloumns.add(new datacolumn("EmpNo"))
---Like that u can use after
for i=0 to ds.tables(0).rows.count-1
dr=dt.newrow
dr=ds.tables(0).rows(i).item("EmpNO")
dt.rows.add(dr)
Next
datagrid1.datasource=dt
datagrid1.databind()
else
datagrid1.datasource=nothing
datagrid1.databind()
end if
end sub
Murali Mohan Naidu.Vemula
|
|
|
|
|
Hi,
use datagrid headers and dont use autoGenerateColumns. Mention the columns yourself and then bind the grid to null at the pageload event(Ofcourse in if!isPostBack).
This will help you
Thanks,
Sushant Duggal.
|
|
|
|
|
I am using datatable for displaying in the grid, so i cant make autogenerate to false. Is there any other way to dynamically generate data in the Grid.
From the textboxes i am showing the data directly to Datagrid. Is there any way of displaying it.
|
|
|
|
|
Sir,
I am using the following code for sending the mail.
Dim objMail As New MailMessage<br />
<br />
objMail.From = "pankajgarg10@rediffmail.com"<br />
<br />
objMail.To = "amaneet.brar@rediffmail.com"<br />
objMail.BodyFormat = MailFormat.Text<br />
objMail.Priority = MailPriority.High<br />
objMail.Body = "This is my first email sent via ASP.net"<br />
Dim smtp As SmtpMail<br />
smtp.SmtpServer = "digitech"<br />
smtp.Send(objMail.From, objMail.To, "abc", "wdc")
and there occurs the following error
The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for amaneet.brar@rediffmail.com
Please help
|
|
|
|
|
Hi amaneet,
There is an option to be enabled before you start sending emails.
In the IIS , go to SMTP Server -- > right click select properties.Under the tab "access", the last option is for Relay. Tick the checkbox at the bottom and coose the option "All except the list below" from the two radio buttons,
I hope this works,
Thanks
Sushant Duggal.
|
|
|
|
|
Hi friends,
Can anyone tell me from where I can get Mail Editor like the one in Microsoft Outlook..
Basically I want an Interface for sending HTML mails with images in the body or files as attachments.
Thanks for your time,
Sushant Duggal.
Sushant Duggal.
|
|
|
|
|
You may wish to have a look at FreeTextBox[^]. It is a WYSIWYG editor for HTML that supports several themes, one of which is Office 2003. It is a generic text input control, however. You'll need to handle the mail portions on your own.
Hope that helps to get you started.
--Jesse
|
|
|
|
|
Hi,
I want to send a ASP.NET mail with embedded images in the mail body. Can any one help me with how I can do that.
I am using ASP.NET 1.x
Thanks
Sudhakar
|
|
|
|
|
You may wish to take a look at my reply[^] to your earlier posting of this question. I included several links to help you get started.
--Jesse
|
|
|
|
|
I have created web application in Asp.net 1.1. Now I want to create the home page such that the client can personalise the page to view weater,stock, tec details. (Like the Google Home page)
The client should be able to change the layout of the home page also. In ASp.net 2.0 we can use Webpart tool for this.. But i didn't get any help for asp.net 1.1.
i am using webservices to show the weather and stock details in the page.
Can anyone help me to change the layout of the page by client?
Thanks
|
|
|
|
|
I am using VS 2005 and SQL Server 2000. I want to store a huge of text in a field of my database.I have used ntext type but it's not large enough.
Can anybody help me.
Thanks
|
|
|
|
|
How big are the text fields that you are storing? ntext's length is 2^31 - 1 characters...
You must have a whopping server...
but anyway, i believe that is the largest data type field available in sql server. Can you maybe store the text in .txt files on a server and then store the link to them in the DB?
|
|
|
|
|
char - Fixed-length non-Unicode character data with a maximum length of 8,000 characters.
varchar - Variable-length non-Unicode data with a maximum of 8,000 characters.
text - Variable-length non-Unicode data with a maximum length of 2^31 - 1 (2,147,483,647) characters.
nchar - Fixed-length Unicode data with a maximum length of 4,000 characters.
nvarchar - Variable-length Unicode data with a maximum length of 4,000 characters. sysname is a system-supplied user-defined data type that is functionally equivalent to nvarchar(128) and is used to reference database object names.
ntext - Variable-length Unicode data with a maximum length of 2^30 - 1 (1,073,741,823) characters.
Tarakeshwar
MCP, CCIE Q(R&S)
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes.
!sgub evah t'nseod margorP sihT ?sgub naem ayaddahW
|
|
|
|
|
|
sorry if the question is stupid
When I store the content of an article in SQL Server ,I only insert a half of it and I can type anymore.I don't know how ->post question.Anyone who know about my problem can help me?Thanks.
|
|
|
|
|
HI
I am using an imagefield in grid view.
<asp:imagefield datafield="photo" headertext="Picture">
In some rows the image is null . I want to specefy this default image (no photo) for these rows.
How to do it
|
|
|
|
|
hi everybdy
i m binding the different dropdownlist in formview for edit and add new records. the datasource is differnt for formview and dropdownlist. when i am addding the new records its work properly. whilei am trying to edit the record an error occur for defferent dropdownlist like dropdownlistArea has selectedvalue which is invalid but it does not exist in the items.
pls tell whats problemn is there?
Best Regards,
Srinandan
-- modified at 10:08 Monday 3rd July, 2006
|
|
|
|
|
Hi,
i want to access my .net controls like asp:label,asp:Button etc... through javascript click event which is going to call on a checkbox, Is it possible? If yes please send me some code for it.
Regards,
AbuBakar
|
|
|
|
|
Hello
function AccessASPControl()
{
//For Label
var lbl = document.getElementById(Lable1).innerText;
//for Button & TextBox
var btn = document.getElementById(TextBox1).value;
var chk = document.getElementById(CheckBox1);
if(chk.checked == true)
//do something
else
// something
}
regards
GV Ramana
|
|
|
|
|