Click here to Skip to main content
15,909,030 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: session problem Pin
Guffa13-Sep-07 11:49
Guffa13-Sep-07 11:49 
QuestionWierd version problem Pin
Richard Jones13-Sep-07 8:58
Richard Jones13-Sep-07 8:58 
QuestionBody tag OnBeforeUnload, and Onunload event in IE7, FF [modified] Pin
Ganesh Kalaiarasi13-Sep-07 3:57
Ganesh Kalaiarasi13-Sep-07 3:57 
AnswerRe: Body tag OnBeforeUnload, and Onunload event in IE7, FF Pin
Brent Lamborn13-Sep-07 5:53
Brent Lamborn13-Sep-07 5:53 
GeneralRe: Body tag OnBeforeUnload, and Onunload event in IE7, FF Pin
Ganesh Kalaiarasi13-Sep-07 23:48
Ganesh Kalaiarasi13-Sep-07 23:48 
QuestionSoapException Pin
Prashant C13-Sep-07 0:58
Prashant C13-Sep-07 0:58 
QuestionValidation Pin
Tsepoz13-Sep-07 0:38
Tsepoz13-Sep-07 0:38 
AnswerRe: Validation Pin
Brent Lamborn13-Sep-07 7:20
Brent Lamborn13-Sep-07 7:20 
Set the Page_ValidationActive javascript variable to false in the button's OnClick event.

This works:

In your ASPX (had to remove beginning angle brackets to get it to render on CP Smile | :) ):

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    asp:RequiredFieldValidator runat="server" id="rfv" ControlToValidate="txt" ErrorMessage="Error"></asp:RequiredFieldValidator>
    asp:TextBox runat="server" ID="txt"></asp:TextBox>
    asp:Button runat="server" ID="btn" Text="Go" OnClick="btn_Click" />
    </div>
    </form>
    <script>
        
        function TurnOffVal()
        {
            Page_ValidationActive = false;
        }
    </script>
</body>
</html>


And in the code behind:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        btn.Attributes.Add("onclick", "TurnOffVal();");
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        Response.Redirect("http://www.codeproject.com");
    }
}



"Half this game is ninety percent mental." - Yogi Berra

If you can read thank a teacher, if you can read in English, thank a Marine.

Questionhow to make website live Pin
harryforum13-Sep-07 0:20
harryforum13-Sep-07 0:20 
AnswerRe: how to make website live Pin
L Viljoen13-Sep-07 2:04
professionalL Viljoen13-Sep-07 2:04 
QuestionHow to create Components for web applications? Pin
venkatinaidu12-Sep-07 23:31
venkatinaidu12-Sep-07 23:31 
QuestionDataAccess Layers & Speed Improvements Pin
L Viljoen12-Sep-07 21:01
professionalL Viljoen12-Sep-07 21:01 
AnswerRe: DataAccess Layers &amp;amp; Speed Improvements [modified] Pin
Manuel F. Hernandez13-Sep-07 7:57
Manuel F. Hernandez13-Sep-07 7:57 
QuestionMass mail sender app Pin
firestoper12-Sep-07 19:22
firestoper12-Sep-07 19:22 
AnswerRe: Mass mail sender app Pin
led mike13-Sep-07 4:46
led mike13-Sep-07 4:46 
GeneralRe: Mass mail sender app Pin
Manuel F. Hernandez13-Sep-07 7:33
Manuel F. Hernandez13-Sep-07 7:33 
QuestionFireFox select scrolling issue Pin
Brent Lamborn12-Sep-07 5:53
Brent Lamborn12-Sep-07 5:53 
AnswerRe: FireFox select scrolling issue Pin
Shog912-Sep-07 9:03
sitebuilderShog912-Sep-07 9:03 
GeneralRe: FireFox select scrolling issue Pin
Brent Lamborn12-Sep-07 9:57
Brent Lamborn12-Sep-07 9:57 
GeneralRe: FireFox select scrolling issue Pin
Shog912-Sep-07 10:11
sitebuilderShog912-Sep-07 10:11 
Questionneed info about creating popup menu in javascript Pin
Dudhat11-Sep-07 23:20
Dudhat11-Sep-07 23:20 
AnswerRe: need info about creating popup menu in javascript Pin
Shog912-Sep-07 9:13
sitebuilderShog912-Sep-07 9:13 
AnswerRe: need info about creating popup menu in javascript Pin
VIRAGHJAIN12-Sep-07 23:37
VIRAGHJAIN12-Sep-07 23:37 
QuestionProblem with display page in Opera Pin
Dudhat11-Sep-07 23:16
Dudhat11-Sep-07 23:16 
AnswerRe: Problem with display page in Opera Pin
Johnny ²12-Sep-07 0:09
Johnny ²12-Sep-07 0:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.