标签: asp.net

  • Redirection in a Page with Validation Objects

    I’ve been up to a new C# with ASP.NET project lately, and I plan to record down the problems occurred along the development, of course, with solutions.

    Here is the first one, about Redirection and Validation. It’s pretty simple, or, I should say amateur. You got it, amateur is who I am. ^^

    I encountered this problem that, Okay, here comes the

    Problem Description

    I’ve got a Button object with OnClick Event in page1, which, when clicked, Response.Redirect to page2. Meanwhile, I have some Validator objects in page1, too. The thing is, the client-side Validation occurs before even reaching the Event for the Button. That is to say, the Validators prevent Redirection from happening.

    Solution

    You’ll love this because it’s so easy. In the Button’s properties list, find "CausesValidation" and set it to false. That’s it.

    My thought is, there’s always some property control if an operation is generated on the server-side.

  • DataFormatString in GridView

    I’ve been working on an ASP.NET project lately, which means it’s high time I write something down to build up my own knowledge base and track down my trail of learning how to code effectively. Hence this article, just another ASP.NET record.

    (更多…)