Friday 21 October 2011

How to open a link button in a new browser window?



I have text box and beside to it I have a linkbutton showing the link that is present in the text box. I am getting the URL from the website into the text from database.I need to open the link button in a new browser window.


aspx page

ASP.NET Syntax (Toggle Plain Text)
  1. <asp:Label ID="lblBusinessURL" runat="server" Text="Label"></asp:Label>
  2.  
  3. <asp:LinkButton ID="lnkBusinessURL" runat="server" ></asp:LinkButton>


aspx.cs page
ASP.NET Syntax (Toggle Plain Text)
  1. string businessurl;
  2. businessurl = DSabc.Tables[0].Rows[0]["BusinessURL"].ToString();
  3. if (businessurl.Contains ("http://"))
  4. {
  5. lblBusinessURL.Text = "<a href=" + businessurl + ">" + businessurl + "</a>";
  6. }
  7. else {
  8. lblBusinessURL.Text = "<a href=http://" + businessurl + ">" + businessurl + "</a>";
  9.  
  10. }

HI there I want to change the font style of a label to either bold, italic, etc.. using a dropdownlist in an aspx page. Please let me know what I'm doing wrong here, because nothing seem to work. My Code

:
public void button_click(object sender, EventArgs e)
{
    var select= font1.SelectedItem.Value;
    if(select=="Bold")
    {
        // I have the following methods of doing this; None works for me.
        label1.Style["Font-Weight"]="bold";
        //I also tried this:
        label1.Font = new Font(label1.Font, FontStyle.Bold);
        //and this:
        this.label1.Font= new Font(this.label1.Font, FontStyle.Bold);
    }
}
When using .Font I get errors for invalid arguments, that the arguments for Font must be like this: Font(string, float). Also, keep in mind that the method of putting the actual size in the argument list is not what i want to do. Like this
label1.Font=new Font("Arial", 16, FontStyle.Bold);
//I don't want to change the font family or sixe of the label's text

Friday 14 October 2011

Differance between Websites and portal

Web site: A website (or Web site) is a collection of web pages. It contains info about the particular company which as hosted it.

For eg: NDTV.com, will contain info about latest news, other program info etc; all company sites comes under this.

Web portal: Web portal is also a website that offers a broad array of resources and services, such as e-mail, forums, search engines, and on-line shopping malls etc; etc;

Eg: Consider yahoo - you have yahoo mail, answers, chat, online shopping and so many things .. news etc; so it is something that offers various services which a company website may not offe