|
The best bet is to store it in a HiddenField control, then document.getElementById to retrieve it on the client side
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi all
i am maintaining a project a have a form addrecord.aspx use FormView control having different dropdownlist with different datasource. formview control use1 sqldatasource1 to bind using visual tool.if the database table have a single or more record then formviw appear in addnew and edit mode.if there is not record in database table the formview not appear. give a msg no record found. i want a interface to insert the first record if the database table has is empty. all the code used in configuration mode(html) so i am not getting when i check
IS sqldatasource is null.
if (sqldatasource ==null)
FormView1.ChangeMode(FormViewMode.Insert);
like this.....
i am not getting the event.
i got some idea from codeproject but i am not getting exact what i should do.
so have explain my problem.
please send me the suggestion with code.
Thanks in advance .
srinandan
|
|
|
|
|
cant you check in the Selecting event and determine if you have anything to show ?
regards,
g00fy
|
|
|
|
|
srinandan.. wrote: all the code used in configuration mode(html)
What do you mean by this?
srinandan.. wrote: if (sqldatasource ==null)
Why do you check the SqlDataSource instance?
What I said in the other post is to use the Selected[^] event of the SqlDataSouece control, and do a checking on the e.AffectedRows .
|
|
|
|
|
thanks to solve my problem
be connect.........
|
|
|
|
|
hai
can we see the code of methods and etc of a system namespace if yes how?
plz help
mam_snigdha
|
|
|
|
|
disassemble it. google is your friend here
regs,
g00fy
|
|
|
|
|
How to use mouseover event on datalist control.
thanx
|
|
|
|
|
I have a button on an aspx file called page A. so when i click the button, page B will pop up and need to send a command to printer to print the page B, sp can somebody share the coding for me how i code the printer function ? Thanks..
regards,
Ken
|
|
|
|
|
|
Hi all,
I am running ASP 2 on IIS 5.1 XPPRO and I have enabled customErrors, so i though i would see how they look locally and set mode=On.
this is the code that fires the exception:
protected void AddToQuoteButton_Click(object sender, ImageClickEventArgs e)
{
try
{
Guid guid = new Guid(Request.QueryString["id"]);
QuoteManager.AddToQuote(Page, guid);
}
catch (Exception ex)
{
throw new Exception("Illegal Product Code in query string.", ex);
}
}
and this is the custom 500 error page logic
public partial class _500 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(Server.GetLastError() != null)
{
string error = Server.GetLastError().Message;
ErrorLabel.Text = error;
Server.ClearError();
}
}
}
so i load a page which requires a Guid on the querystring (but i chop some of the guid off) then click the button whose handler is above, and it goes to the 500.aspx page but Server.GetLastError() is always null.
note: it is suppose to go to 500.aspx on load but i disabled that to do some testing.
why is this?
kind regards,
g00fy
-- modified at 2:02 Thursday 13th July, 2006
this is the web.config section
<customErrors mode="On" defaultRedirect="~/500.aspx">
<error statusCode="404" redirect="~/404.aspx"/>
</customErrors>
|
|
|
|
|
Try above code in Page_Error event, rather than Page_Load
It always return null in Page_Load
Kumar Prabhakar
|
|
|
|
|
|
thank you both
regards,
g00fy
|
|
|
|
|
My problem is like this.
In a page i have controls to add contacts
FirstName
Lastname
Address
Zip etc..
The page has two buttons "Add " and "Save "
+ on clicking Add button the content in the controls need to be stored temporarly in client client. And listed in a table below. Its also possible to delete an item from Added list.
+ on clicking Save all contacts stored temporarily need to be submitted to server and update to the database
means post back must occur only on clicking "Save "
How to do this. It must support cross browser.
|
|
|
|
|
|
postback will happen as per you solution
|
|
|
|
|
Private dt As New DataTable
In Page_Load event
If Not Page.IsPostBack Then
dt.Columns.Add("fName", GetType(System.String))
dt.Columns.Add("lName", GetType(System.String))
viewstate("dt") = dt
End If
In btnAdd_Click Event
Dim dt As DataTable = viewstate("dt")
Dim dr As DataRow
dr = dt.NewRow
dr(0) = txtFname.Text
dr(1) = txtLName.Text
dt.Rows.Add(dr)
DataGrid1.DataSource = dt
DataGrid1.DataBind()
viewstate("dt") = dt
On Save Click, You should get table from viewstate variable and store data in database
Kumar Prabhakar
|
|
|
|
|
If you don't want a postback to occur when clicking the add button you can either use some javascript to save the values to a hidden field or use AJAX to place them in temporary storage (session, database...) until the save button is clicked.
|
|
|
|
|
Hai mark
Thanks for your time
Can you provide me with some snippet/article to do it using JavaScript.
|
|
|
|
|
Can any body help me to get a detailed book on Microsoft content management server 2002?
i am very much in a need of that.
advanced ThanX
Ramesh.Kanjinghat
|
|
|
|
|
Hi all
I want to put the (i, j) values into a 2 Dimensional Array
Can any one plz give the syntax of this
MYCODE
-----------------------------
Dim i As Integer
Dim j As Integer
For i = 0 To a
For j = 0 To b
Console.WriteLine(NewData(i, j))
Next
Next
------------------------------
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
IMHO, you may either pick up a basic programming book or see MSDN for this kind of questions.
Arrays in Visual Basic [^]
Also, your question should belong to the VB.NET forum, not the ASP.NET.
|
|
|
|
|
Hi
Thx for reply
'--------------------------------------------------------
Dim i As Integer
Dim j As Integer
For i = 0 To a
For j = 0 To b
Response.Write(NewData(i, j) & "")
Next
Next
'---------------------------------------------------------
In my code i am trying to add the (i,j) values to array
The array is not taking the values of (i,j)
I add like this
'---------------------------------
Dim Data As New ArrayList
data.add(NewData(i, j)
'---------------------------------
How can i retrive the (i,j) from here
THX
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
I have a slight problem, I am developing an ASP.NET 2.0 website that uses themes (currently only one). The site theme is specified in web.config as <pages styleSheetTheme="White"/> . It was working great until I wanted to start adding RSS support. I am adapting an rss example from the Atlas wiki site starter kit. The aspx file is just an empty aspx file and the aspx.cs file generates the xml, and delivers it via Response.Write . I have used this method in previous asp.net 2.0 applications without problem, however this is my first time with themes.
My problem is this:
System.InvalidOperationException: Using themed css files requires a header control on the page. (e.g. <head runat="server" />).
I tried setting EnableTheming to false for the page and had the same problem. Anyone have any ideas?
Matt Newman
Even the very best tools in the hands of an idiot will produce something of little or no value. - Chris Meech on Idiots
|
|
|
|