|
Hi All,
I am facing some problem in passing tweo parameters using Eval in GridView.
I tried like this, but there is some javascript error-
<asp:hyperlink id="HyperLink2" runat="server" navigateurl="">]]>'
Text= '<%# Bind("AcceptNumber") %>'>
//the javascript function--
function OpenDialog(rid,AcceptNumber) {
window.showModalDialog( "PopupAccept.aspx?ReturnList?ReportNumber= "+ rid+ "&AcceptNumber="+ AcceptNumber+ " ',window, 'dialogWidth:800px;pxcenter:yes;help:no;resizable:no;status:no ")
}
when i click on hyperlink in GridView, it shows some havascript error.
this error says that the second parameter i passed , is not identified.
can anybody tell me how to pass two parameters in a javascript function using Eval.
Please help me.
|
|
|
|
|
I miss an ; at the end of your :
window.showModalDialog( "PopupAccept.aspx?ReturnList?ReportNumber= "+ rid+ "&AcceptNumber="+ AcceptNumber+ " ',window, 'dialogWidth:800px;pxcenter:yes;help:no;resizable:no;status:no ")
Another way is to fill 2 hidden fields within this page through your JS.
After filling these hidden fields do a __Postback(...... (search for __Postback).
Your page will reload and in your codebehind (.aspx.cs file) you can check if the hiddenfields have a value.
|
|
|
|
|
|
I am trying to write a web application using Visual Web Developer 2008 Express edition that uses Virtual Earth and I'm stuck on how to call a certain function from an asp:button event handler.
I'm using the code-behind structure for my webpage. I have one file, cogenmap.aspx, that contains the html for the webpage, and another file, cogenmap.aspx.vb, that contains the Visual Basic code for the webpage.
in my cogenmap.aspx file I have the button declared as follows:
<asp:Button ID="buttonAddUnit" runat="server" Text="Add Unit" />
and in my cogenmap.aspx.vb file I have the event handler written as follows:
Partial Class CogenMap
Inherits System.Web.UI.Page
Protected Sub buttonAddUnit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles buttonAddUnit.Click
Try
'Dim newCoordinates As New VELatLong(CDec(textLatitude.Text), CDec(textLongitude.Text))
Catch ex As Exception
End Try
End Sub
End Class
textLatitude and textLongitude are asp:textbox components and I can reference them with no problems.
The problem is that it can't find the VELatLong function in this context. In the cogenmap.aspx file the line:
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"></script>
allows me to use the VELatLong function with no problem from a client side script block in the cogenmap.aspx file. But I don't know how to reference it from the cogenmap.aspx.vb file, using VB code instead of ECMAScript.
How can I control my Virtual Earth map display from other ASP.NET controls I have placed on the page, such as this button?
|
|
|
|
|
rushinge wrote: using VB code instead of ECMAScript.
You should use javascript in your pages so that they run on browsers that are not IE. You cannot call this from the code behind, you need instead to create a normal HTML button that calls a javascript method which does what you want on the client side.
I recommend reading a book on ASP.NET so that you understand the difference between the client and the server, this is why you can't call a client method on the server side, and it's really fundamental to you understanding ASP.NET.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello.
I wrote a simple web service using VS2005.
The web service has one method “Add” that gets 2 numbers and add it.
I tested the web service and it worked fine.
I wrote a simple client that used this web service method. (I used “web reference” to add that web service ).
The client worked OK as well But, when I tried to use it Asynchronous but it didn’t recognize the method “BeginAdd” that should have been created by the WSDL.exe.
What should I do in order to create these functions so I could use the web service Asynchronously with a callback.
Thanks
Shay
p.s.
i'm a beginner with c#
|
|
|
|
|
I have a couple of pages where a client can make edits in content, the client can toggle to whatever page he wants to make changes.
I really don't want to hit the db with updated content till the last minute. How can I keep the content with changes the client makes resident on each web page's respective form, until the last minute when he can update all pages to the db at once?
I thought maybe XML, but I do not know if that is a pig on resources & speed as compared to hitting the db. Someone also mentioned javascript, i.e. something like "parent.frames[0].document.getElementsByName" but I dont know anything about that script.
Anyone have a miser way to keep several pages of multiline "ajax multi line text boxes" that have been edited, "alive" with changes visible as user toggles back and forth the several pages until the last minute where a button will update all the pages at once to the db?
|
|
|
|
|
The obvious way is to make your several pages, controls all on the one page, and navigation just changes which control is visible. Then, all of your changes will remain in viewstate until you save them all to the DB in one go
javascript is hardly going to help, as it runs on the client, not the server. You should understand js if you're using AJAX, at some point you may dig into what your library is doing for you, to work out why it works the way it does.
XML is just a string, but it doesn't really answer the question. XML is a format, but that doesn't explain how you store it, or where.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I understand what you are saying.
But, I know of a website where the pages with forms are in their respective URL folders with last edits shown.
Does this mean that website is absolutely hitting the database everytime the person moves off the page after editing it to another?
|
|
|
|
|
Not necessarily, it could be storing data in the session. But, that's nasty, you should avoid that.
But, it is possible that they are, yes.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I agree. So then, if session objects are not being used, nor cookies or anything client side, are you saying they MUST be doing interim updates?
|
|
|
|
|
If they are not using the approach I suggested, then I believe so, yes.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Theres also the application cache, which isnt strictly session.
The technique I tend to use for this is to keep the graph of business objects in the ViewState between postbacks, and then commit the lot to the database on save. This works well when the client wants to add a new record and a bunch of child objects before saving.
|
|
|
|
|
Yeah, that's what I've been advocating, too.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It does cause friction sometimes when you deliver something like that and the client says "But our inhouse IT guys said it was impossible to add child data without saving the parent first!".
Cue dirty looks :P
|
|
|
|
|
Hi,
I need to post details of items purchased on my site to PayPals site. If i was using html it would be a simply cut n paste of the html form code. However as .Net uses a form for its pages, i cant simply add this extra paypal form to my page.
Can anyone give me help / pointers on how i go about posting form data to a 3rd party site (PayPal) with using Get method and posting everything in the Url?
Thanks in advance!
|
|
|
|
|
You can actually adopt the hidden field and then distribute to the PayPal form through a simple javaScript trick. That should not be difficult right?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Ok, but can you please explain how to do this or point to a link?
|
|
|
|
|
munklefish wrote: as .Net uses a form for its pages, i cant simply add this extra paypal form to my page.
Yes, you can. A page is not limited to a single form.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: A page is not limited to a single form.
You didn't mean server side form, right ?
|
|
|
|
|
N a v a n e e t h wrote: You didn't mean server side form, right ?
Right. I ment form. Perhaps I should have been more clear, but on the other hand if you try to use two server forms on a page, you get a very informative error message telling you that this is not possible.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Yes. Is there anyway to change this behavior ? Will overriding the Form class help to avoid this error ?
|
|
|
|
|
Hi,
I have a number of checkboxes in a datalist, which is populated by a database. When the user submit the page form i need detect how many and which checkboxes are ticked. However the number of checkboxes may/will vary over time as the site administrator adds/removes options.
So how do i check which boxes are ticked?
Any help & suggestions would be greatly appreciated.
Thanks!
|
|
|
|
|
Hi
I am using the asp.net login control and I am trying to stop one user loggin in several times opening several sessions
is there a way to do this, is it through the web.config file?
cheers
|
|
|
|
|
Do you mean you wish to prevent users from opening several instances of a browser and logging in to you site? Nothing in the web.config will prevent this that I am aware of. You needed come up with a mechanism to handle this.
only two letters away from being an asset
|
|
|
|