|
Well. It looks like all the parameters are in html controls on teh page, apart from VIn (which you could put in a hidden field). So potentially, you could access all of these using javascript and then do your redirect :
var fname;
fname = window.document.form1._lblFirstNameValue.Text
... umm actually...
hmm..
Not too sure that javascript likes all your underscores though...
|
|
|
|
|
I think that paddyboyd proposed you a good solution, but if you want to keep your server side code, then you can store value returned from confirm(...) box to a hidden field and then just read it from this field on server side.
You didn't mention which version of .NET you are using, but in ASP.NET 2.0 it should be roughly like this:
<asp:HiddenField runat="sever" id="myHiddenField"/>
protected void Page_Load(object sender EventArgs e)
{
_lnkDLpurchase.Attributes.Add("OnClientClick",
"document.getElementById("myHiddenField").Value = (confirm('Will Lessee buy this vehicle?')) ?
"lease" : "dealer");
_lnkDLpurchase.Attributes.Add("OnClick", "_lnkDLpurchase_Click");
}
protected void _lnkDLpurchase_Click(object sender EventArgs e)
{
switch(myHiddenField.Value)
{
case "lease": ...
case "dealer": ...
}
}
I wrote it from head, maybe there are mistakes but I hope you understand what I mean.
I hope it helps.
-- modified at 11:00 Friday 30th June, 2006
|
|
|
|
|
Hello,
Thanks. Yes this might work for me in my scenario. By the way yes, I am using ASP.NET 2.0 but using VB.NET. So I will have to code your in VB.NET. I will difenitely have more questions on this while I am working on this. I will keep this posting update. So I need your help
Thanks again,
-L
|
|
|
|
|
Also we are using Master pages. So may be I will have to use FindControl to find and identify myHiddenField (in your code) and then go from there. Let us how it goes. Sooner or later I will definitely update with my accomplishment on this.
Thanks
-L
|
|
|
|
|
There are a couple of things come to mind after seeing your code:
+ In the ASP.NET 2.0, you simply use the OnClientClick to add the handler for the client side event onclick of the LinkButton instead of adding to the Attributes collection in code.
+ If you do nothing in the LinkButton click event handler other than calling the Redirect method, you might consider using the hyperlink control instead of the LinkButton to reduce the round trip. Also you can use javascript to collect the input textboxes to build the url for the href attribute of the hyperlink.
+ If you put a lot of things including the text values (from what I have seen in your code) in the query, I think it does not looks good for example when the text length is significant. In this case, you might consider cross-page posting to post a new page which is determined by the result of the confirmation.
|
|
|
|
|
How can i disable dates that are less then today's date in a Calender Webserver Control
|
|
|
|
|
You simply create the DayRender event handler, and do a checking on the rendered date to make it selectable or not.
void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
e.Day.IsSelectable = (e.Day.Date >= DateTime.Now);
}
|
|
|
|
|
I would like to know how to use an ASP.NET 2.0 text box as a password box, much like the windows form textbox's property called password character. I observed that web text box does not have that property.
Can someone please advice me on how to d this?
Live in fragments no longer. Only connect.
|
|
|
|
|
add the TextMode="Password" attribute to the declaration
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Thanks
Live in fragments no longer. Only connect.
|
|
|
|
|
Hi guys,
Howz all doing!!
My problem is my ASP.NET application is loading very slow. When i debuged it, i found its not because of the code it is running slow its after the Load_complete event(which is the last event for any page) it is taking hell lot of time. Can anyone tell me reason behind it or i am missing some attributes to set.
Thanks in advance..
Sheel Gohe
|
|
|
|
|
For the record, LoadComplete is not the last event. Other events such as PreRender and Render occur after this.
How big is your web page? How many child controls are on the page and what is the size of the HTML source once the page has displayed?
Without knowing exactly what you're doing, it is rather difficult to diagnose your problem.
Visit Riverside Internet[^]
|
|
|
|
|
Check that the site isn't compiling all pages every time - usually get a re-compile on a change, but have heard of people ending up with it compiling regardless all the time
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
sir;
i m useing window2000 operating system i m working on an application in .net . when i inserting the values into database the following error message appear "Could not find installable ISAM."
the connection could not open
help me please
Thanks & Regards
Sandeep
-- modified at 9:11 Friday 30th June, 2006
|
|
|
|
|
|
Hi,
I have two dropdownlist.one for state and another for district. according to the selection of state(in the 1st dropdownlist) the districts in the 2nd dropdownlist will be filled. Can any one tell me how can i achieve this with out submiting the page to the server.
Thanks & Regards
Mishra
|
|
|
|
|
Hi,
Use AJAX
Thanks,
Sushant Duggal.
|
|
|
|
|
In ASP.NET 2.0 there is possibility to implement Client Callback, it can comunicate with server without doing postback:
http://www.dotnetjunkies.com/Article/E80EC96F-1C32-4855-85AE-9E30EECF13D7.dcik
http://www.codeproject.com/aspnet/ScriptCallbackFramework.asp
|
|
|
|
|
Hi all,
I am implemeting custom paging in my datagrid.
Normally for inbuild paging we write navigation code
Sub Pageing_Routine(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs)
SearchGrid.CurrentPageIndex = e.NewPageIndex
FillGrid()
End Sub
But as I am using custom paging I have to implement navigation code for navigation.
mycode is...
<asp:linkbutton runat="server" cssclass="pageLinks"
="" id="FirstPage" text="[First Page]" oncommand="NavigationLink_Click" commandname="First">
<asp:linkbutton runat="server" cssclass="pageLinks"
="" id="PreviousPage" text="[Previous Page]" oncommand="NavigationLink_Click" commandname="Prev">
<asp:linkbutton runat="server" cssclass="pageLinks"
="" id="NextPage" text="[Next Page]" oncommand="NavigationLink_Click" commandname="Next">
<asp:linkbutton runat="server" cssclass="pageLinks"
="" id="LastPage" text="[Last Page]" oncommand="NavigationLink_Click" commandname="Last">
<asp:datagrid id="SearchGrid" runat="server" autogeneratecolumns="False" onpageindexchanged="Pageing_Routine" allowpaging="True" pagesize="3" allowcustompaging="true" pagerstyle-visible="false">
..........
Protected Sub NavigationLink_Click(ByVal sender As [Object], ByVal e As CommandEventArgs)
Select Case e.CommandName
Case "First"
_currentPageNumber = 1
Case "Last"
_currentPageNumber = Int32.Parse(TotalPages.Text)
Case "Next"
_currentPageNumber = Int32.Parse(CurrentPage.Text) + 1
Case "Prev"
_currentPageNumber = Int32.Parse(CurrentPage.Text) - 1
End Select
SearchGrid.CurrentPageIndex = _currentPageNumber - 1
txtpagecount.Text = SearchGrid.PageCount (I expect Total Pages count but it is 1 every time)
FillGrid()
End Sub
If Any one knows something,Please share with me
Regards,
Nagraj
-- modified at 8:25 Friday 30th June, 2006
|
|
|
|
|
I know a girl that might be abel to help you
www.datagridgirl.com
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
hi friends i have one problem in asp.net. i need to send weekly and monthly report to the consultants. is there any special scheduler in asp.net bcaz it should send automatically when system starts. Please help. Its urgent.
Thanks.
Prya
|
|
|
|
|
Hi,
Use javascript timer to get datetime & Ajax callback function to call server side method and send your report to your manager. its simple
|
|
|
|
|
It sounds like you need to create a windows service, or possibly a scheduled job within sql server to run once a month. It doesn't sound like the sort of thing ideally suited to asp.net.
|
|
|
|
|
hi want to use mouseover event on image in datalist. can any body help me.
the code will be helpfull
thanks in advance
aavesh
|
|
|
|
|
aavesh wrote: hi
What a useless subject line. Your subject line should tell people a little about your problem. For example: "MouseOver event on Image"
Then your post should explain your problem more clearly. Your request is vague. You want to use the MouseOver event for what reason? What are you trying to achieve.
|
|
|
|