|
I have no OnClick handler defined, and I have tried using onclick (cause the page not to compile and run). I have tried OnClientClick and returning false from the function. I have tried the OnClick which obviously tells me there is not a server side script. Here is a couple of examples:
// Function always returns false. Both client and server side execute.
<asp:button runat="server" id="btnContact" font-size="7pt" height="20" onclientclick="CallContactUpdate(1);" text="Add New">
// Same function errors when compiling.
Error 1 = ) Expected
Error 2 = Invalid expression term ')'
<asp:button runat="server" id="btnContact" font-size="7pt" height="20" onclick="CallContactUpdate(1);" text="Add New">
Leo T. Smith
|
|
|
|
|
Oh - OnClientClick, that's it. IS there an AutoPostBack property on the button class ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Sorry all. My last post I was in a hurry and sent the actual asp:button with html format totally forgetting script injection issues. As to the autopostback; no I didn't set it (it is missing and my understanding is that it makes it false, which I could be wrong for a button). I did notice that when I look at the HTML source code that is generated by the server, the button's type is set to 'submit' and not 'button'. Is there a way to change the type here to 'button' (can't find anything to tell how to set this to 'reset' either). That would resolve this issue. If it would help, I will resend the actual tags to without the > or < literals later.
Thanks,
Leo T. Smith
|
|
|
|
|
As stated elsewhere, the resolution was that I had not setup the OnClientClick event to a return itself.
OnClientClick="MyFunc(); return false;"
Thanks everyone for your assistance.
Leo T. Smith
|
|
|
|
|
Leo Smith wrote: If asp:Button, how do you cancel the server side post and do only the client side script
You can wire a javascript function to the OnClientClick event.If the JS function returns false,the server side post will be canceled.
|
|
|
|
|
This is what I tried and the function returns only false. When the button is clicked, I see what is suppose to happen, then the page immediately posts and all is lost.
Thanks,
Leo T. Smith
|
|
|
|
|
Are you trying like this?
OnClientClick event has "return MyFunction()" code?
|
|
|
|
|
Actually this might be the issue. I didn't have the return inside the onclientclick call. I'll test it and let you know.
Thanks,
Leo T. Smith
|
|
|
|
|
I have RSS feeds displaying on an asp web page. One problem, it is displaying supposedly quotation marks but instead it is displaying a square. I checked in source and saw that it was a question mark. When I tried doing a InStr() and searching for either a quotation mark or a question, I didn't get anything back.
Has anyone ever come accross this issue before in ASP?
|
|
|
|
|
It sounds like you have a problem with encoding. If the RSS feed is encoded using a specific character set, you have display it using the same character set.
The quotation marks in your RSS is probably not the regular inch sign (") that is usually used as a quotation mark, but typographic quotation marks. They are not in the lower 128 characters (ASCII equivalent) of the character set, so if you mess upp the encoding, their character code might not correspond to any character in the character set used. Those are usually displayed as squares. When decoded to unicode using the wrong encoding, they will be converted to question marks.
As RSS is XML, my first guess would be UTF-8 encoding. Check the source of the XML to see if it specifies any encoding.
---
Year happy = new Year(2007);
|
|
|
|
|
hi all,
i don't know exactly it is related to ado and ado.net.
What are the different types of 1.cursors and 2. lock types of “recordsets?” How different are they from “datasets”
i worked on ASP. i know this:
Types of cursors: Static, Dynamic, Forward-only, Keyset-driven.
Types of Locks: Read Only, Pessimistic, Optimistic, Batch
i think these are cursors & lock types of Recordset.. then how they are different form Dataset??
please can anyone clarify my doubt
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Google is your friend.
At a broad level, ADO.NET is designed to work disconnected. A dataset is a collection of tables, it has no cursor, it's filled from the database and then all the data is returned to you. There is no lock, either.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi, Lets say i have 3 textfields in asp.net form and i want check if any of them is empty to my javascript function is that possible to perform. I don't want to create three different function with the same functionality. Please help me
Thanks
I am callling like that
<asp:button id="txtField" runat="server" text="Save" onclientclick="return validateQuestion(txtField);">
function valdateFunction(textField)
{
valid =true;
if(document.form1.textField.value=="")
{
alert("Enter something.");
valid=false;
}
return valid;
}
|
|
|
|
|
yes, I solved my own question all i did is in If statment checked
if(textField.value=="")
|
|
|
|
|
Hi all,
Currently I am doing a project in ASP.NET using C#. I posted this message before but that was a different approach. Now I want to implement it this way. I have a Database in SQL Server containing 5 tables. I have 5 Listbox Controls which I have populated from the 5 underlying tables.
What I want to do is to bind the 5 Listbox Controls to the Repeater Control to display information. I can bind one ListBox to the Repeater Control. But when I try to bind the second ListBox it gives me an error message or it won't show the repeater when I select values from the Listboxes. Does anyone know how to bind More then one ListBox to a Repeater control.
Thanks for your help.
Looking forward to your reply.
Koonda
|
|
|
|
|
I just posted this on an earlier thread I had but since it's a week old I don't think anyone will see or answer it.
I am working with the calendar control and AJAX. Currently I am at a stand still in my pursuit to work smarter not harder. I don't want to make my own calendar control, but the ASP.NET control wants to use a form but since my main page already has a form tag it errors out being a form inside a form. Is there anyway to set the calendar control not to use postback so that it doesn't have to use the form? Should I just make my own calendar?
|
|
|
|
|
The web abounds with free javascript driven calendar controls.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I am writing a log in form for my application. When the user attempt to log in I want to record the IP Address in the database. Is there any way I can get the IP Address of a request from a web page? If yes, how?
|
|
|
|
|
try
Request.ServerVariables["REMOTE_ADDR"]
or
Request.UserHostAddress
|
|
|
|
|
That worked. Thanks!
Voltaire (1694-1778) wrote: I may disagree with what you have to say, but I shall defend, to the death, your right to say it.
Jörgen Sigvardsson , on the subject of Wikipedia, wrote: Some people believe what the bible says. Literally. At least you have the chance to correct the wiki.
|
|
|
|
|
Hello,
I am trying to call aspx page of other web application in content place holder of master page of share point.
But not getting exact way for it. Actually that aspx page contains masterpage attribute attached to it. And this master page attribute point to asp.net masterpage.
And I want to show such aspx pages to master page of share point application.
Will it possible? What could be the way? How to use session created by asp.net in share point pages?
Please help me for the same.
Sachin Gedam
(Software Engg.)
Pune India
|
|
|
|
|
hello
some one have a example of how i get de data from tree view and insert this in 2 table database
for guide me
thanks for the time
|
|
|
|
|
can u tell me how to parse a resume in the word document format which is sent to a company.ie i want to separate the fields like name,emailid,academic merit,skills and experience from a resume format data input
if u can plz tell me
shalumurali16@gmail.com
|
|
|
|
|
Go through each line and compare your search if its found store it or whatever you want to do.
|
|
|
|
|
hi
i was downloaded a sample website from this link : http://www.codeplex.com/MyWebPagesStarterKit
but when i copy this site to my IIS virtual directory and run it,the following error shown me :
...
Line 26: {authentication mode="Forms"}
...
how to solve my problem ?
|
|
|
|