Asheej Kommery's .NET blog
-
Microsoft JScript runtime error: 'Sys' is undefined
"Microsoft JScript runtime error: 'Sys' is undefined" is one of the common error we get when your web.config is not configured properly.
-
Toggling (Expand/collaps) panel using Jquery
Below code will show how can we create toggling (Expand/collaps) panel with very less code.
-
Display all stored procedures containing a string in SQL
Below is a simple stored procedure which can be used to display all stored procedures containing a specific string.
When execute below query it will search for all the stored procedure in the database containing the string "user"
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%user%'
AND ROUTINE_TYPE='PROCEDURE'
-
How to display alert in outlook express if subject field is empty while sending mail
In this article I am going to explain, how you can display alert from outlook if you click on "Send Mail" button without entering subject. This is a simple piece of VB code which will help you to display alert.
This is a common mistake every one does while sending mail using outlook. You feel bad if you send an important mail to the client or higher level manager without subject by mistake.
Since Microsoft didn't provide any option to make the subject mandatory or any warning for the empty subject it is our responsibility to find out the workaround.
This is a VB code which will display alert when you click on Send Mail button in Outlook if subject field is empty.
Just follow below steps,
1. Ofcourse we have to open the outlook
2. Then we will Open Visual basic editor by pressing ALT+F11
3. Then from left pane expand the Project1 untill you see "ThisOutlookSession"
4. Double Click on "ThisOutlookSession"
5. Now it's the time to copy and paste the below code in the new window opened when you double click on "ThisOutlookSession".
6. Save and Close the window. You are done!
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strOutlookSubject As String
strOutlookSubject = Item.Subject
If Len(strOutlookSubject) = 0 Then
Prompt$ = "Are you sure you want to send the Mail without Subject?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Subject is empty") = vbNo Then
Cancel = True
End If
End If
End Sub
Note: Change the alert as per your interest from above code.
Now try to send mail without subject from your outlook you will see that wonderfull alert!!!
-
How to refresh parent window while closing the pop up window in C#
Below is the combination of C# and JavaScript code to refresh parent page while closing the pop window.
First copy below code in the .aspx page you are opening the pop up window, this is a simple JavaScript. Add this Script after Head tag in your HTML page.
function Submitted()
{
__doPostBack('Submit','');
location.reload();
}
Below code should be copied in your page_load event of the page you are opening the pop up,
if (IsPostBack)
{
string arg = Request.Form["__EVENTTARGET"];
string val = Request.Form["__EVENTARGUMENT"];
if (arg == "Submit")
{
//Code to populate/refresh the control
}
And finally in your popup window submit/close button click event write below code,
protected void btnSubmit_Click(object sender, EventArgs e)
{
Response.Write("<script>self .close();opener. Submitted();</script>");
} -
Read XML element and display the data in TextBox
-
How to check windows service status using ASP.NET
How to check windows service status using ASP.NET