retro .net developer's blog;
-
Microsoft Build 2017 - Links & Resources
-
Microsoft Build 2017 - Day 3 Highlights
-
Microsoft Build 2017 - Day 2 Highlights
-
Microsoft Build 2017 - Day 1 Highlights
-
Custom/Div Based Alert In ASP.NET
The post is about implementing Custom/Div based alert messagebox in ASP.NET, using jQuery/jQuery UI dialog plugin. This can be a required thing when you are asked not to use default Browser alert box.
-
AutoComplete alternatives with jQuery
There are alternate ways to implement autocomplete dropdown/textbox component in your Website. One option is to implement Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes
-
Evaluating Windows 10 – A Clean Installation
Aim of the article is to address the issue:
-
Start/Stop Window Service from ASP.NET page
Update: The article has been selected as "Article of the day" on 30th April 2011 at official asp.net (http://www.asp.net) site
-
Linq To SQL: Behaviour for table field which is NotNull and having Default value or binding
I found this something interesting while wandering over community which I would like to share. The post is whole about: DBML is not considering the table field's "Default value or Binding" setting which is a NotNull. I mean the field which can not be null but having default value set needs to be set IsDbGenerated = true in DBML file explicitly.
Consider this situation: There is a simple tblEmployee table with below structure: -
Executing server validators first before OnClientClick Javascript confirm/alert
I got to answer a simple question over community forums.
Consider this: Suppose you are developing a webpage with few input controls and a submit button. You have placed some server validator controls like RequiredFieldValidator to validate the inputs entered by the user. Once user fill-in all the details and try to submit the page via button click you want to alert/confirm the submission like "Are you sure to modify above details?". You will consider to use javascript on click of the button.
Everything seems simple and you are almost done. BUT, when you run the page; you will see that Javascript alert/confirm box is executing first before server validators try to validate the input controls! Well, this is expected behaviour. BUT, this is not you want. Then?
The simple answer is: Call Page_ClientValidate() in javascript where you are alerting the submission. Below is the javascript example:
<script type="text/javascript" language="javascript">
function ValidateAllValidationGroups() {
if (Page_ClientValidate()) {
return confirm("Are you sure to modify above details?");
}
}
</script>
Page_ClientValidate() function tests for all server validators and return bool value depends on whether the page meets defined validation criteria or not. In above example, confirm alert will only popup up if Page_ClientValidate() returns true (if all validations satisfy). You can also specify ValidationGroup inside this function as Page_ClientValidate('ValidationGroup1') to only validate a specific group of validation in your page.
function ValidateSpecificValidationGroup() {
if (Page_ClientValidate('ValidationGroup1')) {
return confirm("Are you sure to modify above details?");
}
}
I have attached a sample example with this post here demonstrating both above cases. Hope it helps./.