Bharath Radhekrishna

dialog box with line break

Posted by: onetidbit on: January 30, 2009

string script = “alert(\”This dummy matter.\”+’\\n’+\” This dummy matter ‘This dummy matter’ \”+’\\n’+\” This dummy matter\”);”;
Page.ClientScript.RegisterStartupScript(this.GetType(), “script”, script, true);

Please wait on button click

Posted by: onetidbit on: January 30, 2009

C#:::

protected void Button1_Click(object sender, System.EventArgs e)

{
System.Threading.Thread.Sleep(5000);
ClientScript.RegisterClientScriptBlock(this.GetType, “reset”, (“document.getElementById(\’”
+ (Button1.ClientID + “\’).disabled=false;”)), true);
}

protected void Page_Load(object sender, System.EventArgs e) {
Button1.Attributes.Add(“onclick”, (ClientScript.GetPostBackEventReference(Button1, “”) + “;this.value=\’Please wait…\’;this.disabled = true;”));

vb.net:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

System.Threading.Thread.Sleep(5000)

ClientScript.RegisterClientScriptBlock(Me.GetType, _ “reset”, “document.getElementById(’” & Button1.ClientID & “‘).disabled=false;”, True)

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Button1.Attributes.Add(“onclick”, ClientScript.GetPostBackEventReference(Button1, “”) _ & “;this.value=’Please wait…’;this.disabled = true;”)

End Sub

Tags:

Using Free Text Box in ASP.NET displaying HTML formatted text

Posted by: onetidbit on: January 9, 2009

Why do we must use FreeTextBox (FTB) control?

This will be useful when we want to display text with HTML formatting with label control.
when you enter the text in FTB it will saves with all the HTML tags in the table.
while displaying the label control along with browser renders HTML.

Before you start with this control you must it in /Bin folder.

Download the Free TextBox at: http://freetextbox.com
In the aspx page put this:

<%@ Register TagPrefix=”FTB” Namespace=”

FreeTextBoxControls” Assembly=”FreeTextBox” %>
But remember add this in <Page> tag of aspx: ValidateRequest=”false”
ex:

<%@ Page Language=”C#” MasterPageFile=”~/MasterPage.master” AutoEventWireup=”true” CodeFile=”EnterFAQs.aspx.cs” Inherits=”EnterFAQs” Title=”Winning Edge :: FAQs” ValidateRequest=”false” %>

<%@ Register TagPrefix=”FTB” Namespace=”FreeTextBoxControls” Assembly=”FreeTextBox” %>

<FTB:FreeTextBox ID=”txt_desc” runat=”server” Width=”300px” Height=”150px”></FTB:FreeTextBox>

Some time while viewing your asp.net pages you will encounter with an error like the below:

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. “
This will be solved if you close the databbase connections in that page.

Tags:

Updating column values at once in sqlserver

Posted by: onetidbit on: November 25, 2008

Here the query looks like:

Update Tablename set[column name]=value;

example : Update employee_details set[salary]=20000;

Place vb and cs files together in App_Code folder

Posted by: onetidbit on: November 25, 2008

Sometimes while using class files in asp.net we will face the situation where we want to place both Vb and Cs class files.The simple solution is:

1) First make two folders in App_code with foldernames as 1)CSCode 2)VBCode

2) Modify the Web.conig with following code:

    <compilation debug="false">
    <codeSubDirectories>
        <add directoryName="VBCode" />
        <add directoryName="CSCode" />
    </codeSubDirectories>
</compilation>

Thats all.....

Get the recent row entered in SQL

Posted by: onetidbit on: November 20, 2008

We can select the recent row enrtered by using the query below.
suppose the table name is employee;
then.

select * from employee where rowid=(select max(rowid) from employee).

This works fine because rowid is assigned for each and every record and in accending order. So the recent record’s rowid is the man (rowid). Please send feedback with any concern
or

You can check it with the help ofSCOPE_IDENTITY( ) function in SQL server 2000 or 2005.

Gridview with fixed header

Posted by: onetidbit on: November 17, 2008

Skin:

1 <asp:GridView SkinID=“skinGridView” runat=“server” BackColor=“White” BorderColor=“#DEDFDE” BorderStyle=“Solid” BorderWidth=“1px” CellPadding=“4″ ForeColor=“Black” GridLines=“Vertical”>
2 <HeaderStyle BackColor=“#D7D4D4″ Font-Bold=“True” ForeColor=“#316AC5″/>
3 <RowStyle BackColor=“#FFFFFF” ForeColor=“#333333″/>
4 <AlternatingRowStyle BackColor=“#F7F7F7″ ForeColor=“#333333″ />
5 <HeaderStyle CssClass=gridHeader />
6 </asp:GridView>

CSS:

1    .gridHeader
2    {
3         position:relative;
4         top:auto;
5    }

Hello  everybody. When I am trying to send an email with HTML format the values are coming from database i felt problem with godaddy server.

నేను ఒకసారి GoDaddy ద్వారా ఈమెయిలు పంపిస్తుంటే చాలా ప్రొబ్లెంస్ వచ్చాయి
నేను వాటిని పరిశోధించి చివరికి చిన్న సమాధానం కనుకునా ఏమైనా సందేహం వుంటే మెయిల్ చెయ్యండి

Email; radhek@gmail.com

To solve that we must add relay hosting.

I’d just like to add that when you’re sending email via “relay-hosting.secureserver.net” you will be able to send email via the GoDaddy server but it will not work if you run it locally. This is normal – it’s a security feature.

Code below

using system.net.mail namespace.

const string SERVER = “relay-hosting.secureserver.net”;

System.Net.Mail.MailMessage objMail = new System.Net.Mail.MailMessage();

objMail.From = new MailAddress(“”);objMail.To.Add(MailId);

objMail.Bcc.Add(BCC);

objMail.IsBodyHtml = true;

objMail.Subject = “Order Confirmation”;

objMail.Priority = System.Net.Mail.MailPriority.High;

objMail.Body = “<h1>hi</h1>”;

SmtpClient Client = new SmtpClient(SERVER);Client.Send(objMail);

U need to Specifie the SMTP CLIENT SERVER LIKE THAT

This is working with my Godaddy Server try out

Gmail down

Posted by: onetidbit on: August 7, 2008

Hi friends My gmail account is not opening from yesterday night i.e 6th Aug 08 and also not opening today.

ఫైరుఫాక్సు లో జిమెయిల్ రావటం లేదు కాని అదే ఇంటర్నెట్ ఎక్సప్లోరర్ లో వస్తుంది

I dont know what happened exactly so I have send a mail to gmail team they send the following reply:

Hello,

Thank you for your report.

We are aware of this problem, and our engineers are making progress to
restore account access. You can find timely updates in the Gmail Help
Discussion group at:
http://groups.google.com/group/Gmail-Help-Announcements-and-Alerts-en/browse_thread/thread/f92b062153654584.
We apologize for any inconvenience this has caused.

Sincerely,

The Google Team

I dont know what happened this is drawback of google.

I have read many blogs and I found that same account is opening in IE.

I tried opening in IE it is working fine.

I dont know what happened with IE only its working.

I must switch to some other alternative to gmail.