|
hello,
Can anybody help me to insert,delete,update in datagridview in asp.net without any postback. or with webservice.
|
|
|
|
|
|
Can anybody describe the whole coding to creating a new session and sending values on next page by using sessions
|
|
|
|
|
|
Just write
session["id"]="1234";
For Retrieving on any page
TextBox1.Text=(string)session["id"];
Casting depends upon type of variable you are using
|
|
|
|
|
|
|
Hi..Hope it helps u
String Mymsg = String.Format("110", authCode, DateTime.Now.ToString(), txtFirstName.Text + " " + txtLastName.Text, txtPayment.Text);
Session["Successmsg"] = Mymsg;
Response.Redirect("Thank.aspx");
In Thank.aspx.cs page:
Label2.Text = (String)(Session["Successmsg"]);
Session.Abandon();
Session.Clear();
|
|
|
|
|
Hi,
i wanna to call the bellow function while the Textbox1 got focus (when user click on Textbox1 OR when user press tab and textbox1 got focus):
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function Open() {
var Return;
var myObject = new Object();
myObject.TextBox1 = document.getElementById("txtFirstName").value;
if (window.showModalDialog) {
Return = window.showModalDialog("childform.aspx", myObject, "dialogWidth:670px;dialogHeight:600px;")
document.getElementById("txtFirstName").value = Return.firstname;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
</body>
|
|
|
|
|
Instead of reposting your question, use the Edit link to update it.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
you should call
$('#txtFirstName').focus(funcation(){
// type code here ...
});
----- OR ------
funcation myfuncation(){
// type code here ...
}
set this funcation in onBlur() event.
|
|
|
|
|
Hi,
i wanna to call the bellow function while the Textbox1 got focus (when user click on Textbox1 OR when user press tab and textbox1 got focus):
<title>Untitled Page
function Open() {
var Return;
var myObject = new Object();
myObject.TextBox1 = document.getElementById("txtFirstName").value;
if (window.showModalDialog) {
Return = window.showModalDialog("childform.aspx", myObject, "dialogWidth:670px;dialogHeight:600px;")
document.getElementById("txtFirstName").value = Return.firstname;
}
}
|
|
|
|
|
Write this in your code behind file:
myTextBox.Attributes.Add("onfocus","javascript: Open();");
This will add the onfocus client side event to your textbox.
|
|
|
|
|
In order to call the JavaScript function, Just use the Following:
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onfocus", "Open()");
}
This will bind the "onfocus" event of TextBox1 to the javascript function "Open()"
|
|
|
|
|
But unlike others i believe you should handle it from your client and not ASP.net.
You should implement it as follow:
document.getElementById("<%= TextBox1.ClientID %>").onfocus=function(){Open();}
|
|
|
|
|
I am a total noob to ASP, so I hope you can bear with me while I get the stupid questions out of the way.
I have an .ASP registration popup form on my webpage that is being attacked by bots. They can't get in because each user must be activated on the server side first, but they are starting to get annoying due to the number of false registrations I have to delete.
I know there is CAPCHA code available, but I want to make it very simple for my customers when they register so I was wondering if I could just add a yes/no type question to my "If/then/else function", for example "is the sky blue", or "are you from Mars", "are you a human", etc. then have a field that has to be filled in with the correct answer, have the answer checked by the statement and if it is incorrect the form is closed or cleared, if it is correct the form stays active and they can submit it.
I don't like the random word images with all the scribbles, some of them are too long or are hard to read, and I'm not very good at coding ASP yet that I could find the right place to put all that code. Also, a humanizer question can be changed at any time very quickly by me if any bot figured it out - IF it would work.
Thanks for any help.
modified 21-Oct-12 19:02pm.
|
|
|
|
|
Use the person's email address as their username for your site is probably the easist.
Once they fill out a basic registration page your website should generate a validation email back to them with some hash code they need to respond with on a secondary validation page.
You create their user account on your server with an expiration date of 48 hours from the time they created their initial account.
You can create logic to kill any accounts that have not been validated and are past their 48 hour expiration window.
Something like that.
|
|
|
|
|
Actually my question was if I can use the if/then/else function to stop them, as that code is already in place, and would require very little modification.
I don't understand ASP well enough yet to do what you suggest.
|
|
|
|
|
The short answer is, Yes, you can use your if/then/else current logic, but I'm sure the bots will be able to quickly get through. If it is a Yes/No question, then they have a 50% change of getting the answer right.
On your current form, make it a two step process.
1) have them enter their email address
2) Your application can send them an email with a code word (random word)
3) Prompt them to enter the code word to verify that they have received the code word.
If the code word matches, let them continue. Redirect them to another page.
|
|
|
|
|
I have seen those email/code response registrations, but I'm not a fan of them as they add extra steps to the registration process for the user, back and forth from the email to get a code.
We are not a high profile site and our customer base is very much a niche market, I only want to stop the bots. I will try the if/then/else first and if it doesn't work, I'll look into the email code. Thanks for the reply, I appreciate your time on this.
|
|
|
|
|
Here is something you might want to investigate.
There is a webservice which validates email addresses. Try the example out; it seems to work.
You could validate the email address and not create the account if it does not validate.
Jut a thought.
http://www.webservicex.net/ws/WSDetails.aspx?WSID=51&CATID=4[^]
|
|
|
|
|
Hi,
what does this code do ?
<script type="text/javascript">
loc += "UserControls/Editor/";
WYSIWYG.attach('txtSharh2');
</script>
and
My Editor file is in :
~/UserControls/Editor
But gives the below error :
loc is undefined
|
|
|
|
|
jojoba2011 wrote: loc += "UserControls/Editor/";
It looks like the code was suppose to define the usercontrol's location. loc should have been a client side variable that has defined root URL to which you add your usercontrol Url.
Based on the error, it looks like you missed writing/copying the loc variable declaration. To get away error, define the variable before assigning a value. And based on my assumption of usage, probably you would need to initialize the variable with root folder path.
|
|
|
|
|
Thanks !
but now i get this error :
"WYSIWYG' is undefined"
MY Code is :
<script type="text/javascript" src="<%# GetUrl("UserControls/Editor/scripts/wysiwyg.js") %>"></script>
<script type="text/javascript" src="<%# GetUrl("UserControls/Editor/scripts/wysiwyg-settings.js") %>"></script>
<script type="text/javascript">
var loc = location.host;
loc = location.protocol + "//" + loc + "/";
loc += "UserControls/Editor/";
WYSIWYG.attach('txtSharh2');
</script>
|
|
|
|
|
jojoba2011 wrote: but now i get this error :
Same reason. WYSIWYG must be defined somewhere. Check the documentation from where you decided to use this editor.
Either WYSIWYG must be defined in it's JavaScript itself or you need to define some place.
|
|
|
|