English 中文(简体)
ASP. 如果我用Javascript Valid的话,Net PostbackURL就没有工作
原标题:ASP.Net PostbackURL doesn’t work if I put in Javascript Validation

我要与你详细谈谈我的问题。

(1) 我的网页上有一个文本箱和一个纽芬兰语,视之为家。

(2) 我写了这样的法典:

<asp:Button id="btnSubmit" runat="server" Text="Submit" PostBackUrl="~search.aspx"
        OnClientClick="validate();" />

3) 我必须检查一下文本箱无效。 如果不是无效,则希望转而进行搜查。 邮局提供的牛奶。

4) 使用java字母(一)验证;

function validate()
   {
      if(document.getElementById( txtCity ).value!=  )
      { alert( please enter the city to search ); returnn false;}
   }

5) 如果案文箱无效。 它警告进入该市。 如果没有,该页就保持不变。 它没有改用搜索网页。

我希望你能够这样做。

问题回答

Kumar, You will need to provide much more information then this.

在你要求的时候,一位盲人猜测是,你在你的网页上有一个可以证明是正确的。 然而,在您的网页上,你也有一条连接点,不应引起验证,而应直接与邮政局联系。

You can accomplish this one of two ways: 1. Add a validation group to your button and all the controls it should validate. 2. On your LinkButton, add CausesValidation="false" to your declaration.

如果这些盲人烟.不有用,请提供更多信息。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签