C# .NET - HYPERLINK

Asked By rami
10-Nov-10 11:12 PM
hi,
i am learning c#.net .
 in my work i want to get a new textbox when i click on a hyperlink i.e., i am giving an option for mobile no and under that i am asking for landline if they dont have mobile no. so if they dont have mobile no they will click on a hyperlink called landline so that they will get an option like phone and a textbox where they can give landline no.
how can i get this ?
  Santhosh N replied to rami
10-Nov-10 11:25 PM
Initially you could hide the two controls (label with Landline no and textbox to enter number) and when you click the hyperlink, in the click event show them..
If you are doing this in asp.net, you can have onclick event of the hyperlink and do this in javascript

stype.display = "inline" would make visible and
style.display = "none" would hide..

ex: document.getElementById('ctrlid').stype.display = "inline";
  Nowshad M replied to rami
10-Nov-10 11:26 PM
Hi,
By default make the Land line textbox visible false and When click on Hyperlink button Just make the landline text box to visible... Sample Code is given below

aspx code

 <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
    <asp:TextBox ID="txtLandLine" Visible="false" runat="server"></asp:TextBox>

cs code

 protected void LinkButton1_Click(object sender, EventArgs e)
    {
        txtLandLine.Visible = true;
    }
  rami replied to Santhosh N
11-Nov-10 12:13 AM
hi
  can you desribe me the solution please because as i am a new learner i am unable to understand wat u have replied me before.
  rami replied to Nowshad M
11-Nov-10 12:24 AM
hi nowshad,
   thanx for ur reply. And a minute clarification that in the properties of hyperlink what should i give in the navigationURL block because unless i give something there i am unable to click on hyperlink.
  Nowshad M replied to rami
11-Nov-10 12:37 AM
Hi 

just give # symbol in that navigate URL
  rami replied to Nowshad M
11-Nov-10 08:29 AM
hi nowshad,
     i am creating a registration form in asp.net in which i have to make atleast one column mandatory out of mobile and landline. so can u please say that how to write code for that.
  rami replied to Santhosh N
11-Nov-10 09:50 AM
hi santosh,
   i am creating a registration form in asp.net in which i have to make atleast one column mandatory out of mobile and landline. so can u please say that how to write code for that.
  Santhosh N replied to rami
11-Nov-10 11:21 AM
I suppose you could only achieve this programatically...

if(String.IsNullOrEmpty(txt1.Text) || String.IsNullOrEmpty(txt1.Text))
{
//your validation here...
}
  Nowshad M replied to rami
11-Nov-10 11:08 PM
Hi,
Try like the below code

if(String.IsNullOrEmpty(txtLandline.Text) && String.IsNullOrEmpty(txtMobile.Text))
{
//message shows of validation
}
else
{
//code of execution
}
  rami replied to Nowshad M
11-Nov-10 11:34 PM
hi
  i am having two registration forms and in both i have name columns. so how can i get the name entered in textbox column of first page into the textbox column of name in second page. can u provide me the coding
  Nowshad M replied to rami
11-Nov-10 11:44 PM
Hi,
You can achieve this in two ways..
1) You can use session variables like below
In form1 in the save button click event write this line
Session["FirstFormName"] = txtName.Text;
In form2 page load u can retrive this value by using folowing code
string FirstFormname ="";
if (Session["FirsrFormName"] != null)
FirstFormname = Session["FirsrFormName"].ToString();

1) You can use session variables like below
In form1 while redirecting to form2 use code like this
Response.Redirect("Form1?FirstFormName=" + txtName.Text + "");
In form2 page load u can retrive this value by using folowing code
string FirstFormname = "";
if (Request.QueryString["FirstFromName"] != null)
FirstFormname = Request.QueryString["FirstFromName"].ToString();
Hope this helps
  rami replied to Santhosh N
11-Nov-10 11:47 PM
hi
  i am having two registration forms and in both i have name columns. so how can i get the name entered in textbox column of first page into the textbox column of name in second page. can u provide me the coding
Convert string to int32  Convert string to int32
12-Nov-10 06:27 AM
hi nowshad,

       in my registration form i am asking for mobile number and it is not mandatory. so if the user did not enter the mobile number an error is coming like failed to convert string to int32. so i need to convert the value in the textbox to int32 so that the database can store null value if the user did not enter any value in the mobile number. can i write the statement like       

         Convert.ToInt32(TextBox6.Text);
before the statement

         cmd.Parameters.Add("@mobile", SqlDbType.Int).Value = TextBox6.Text;
       
  Nowshad M replied to rami
12-Nov-10 06:31 AM
Hey,
First of All you should not create mobile number as Interger because mobile number will have 10 digits, it cannot not be stroed in integer range.

So make it as Varchar(50) datatype in database and then do not convert to Int32 in code behind..
Hope this helps..
  Santhosh N replied to rami
12-Nov-10 08:12 AM
You could actually store in session if you want to use in another page.

In first page add to the session as..
Session.Add("user", txt1.Text);

and in second page display in textbox as

txt2.Text = Session["user"].ToString();

Note: Please post seperate questions in a new thread and dont use the same for all your queries
  rami replied to Nowshad M
12-Nov-10 08:58 AM
hi
    in my registration form the options are like  name,password,confirmpassword,fullname,email,country,state,mobilenumber,linkbutton for landline number.
             The problem is that when i am filling form coming to country and state columns since they are dropdown buttons and while clicking on linkbutton also i am facing problem that the page is getting post back. so after postback the password and confirm password columns which are already entered are getting blank and need to be entered once more.
             so can u give me the idea about this that when i am selecting a value in the dropdown and when i am selecting linkbutton only those fields should be post back or any other idea that these details like password and confirm password should not get blank when i select a value from dropdown or when i click on linkbutton.
  Nowshad M replied to rami
12-Nov-10 11:43 PM
Hi,
The easiest way you can do is you can design in such a way that u can keep your Password Textboxes after your selection of Dropdowns..
  rami replied to Nowshad M
15-Nov-10 02:47 AM
hi nowshad,
   how can i get the data from a databse into a dropdown list.
  like i have a 3 dropdowns like date, month, year. so here i must get dates, months and years in their respective dropdowns and those values i need to get from database. please guide me how to write code.
  rami replied to Santhosh N
15-Nov-10 02:47 AM
hi santosh,
   how can i get the data from a databse into a dropdown list.
  like i have a 3 dropdowns like date, month, year. so here i must get dates, months and years in their respective dropdowns and those values i need to get from database. please guide me how to write code.
  Nowshad M replied to rami
15-Nov-10 04:06 AM
Hi rami,
Use like the below code

//in page load
BindDropdownList("select * from tbldate",ddlDate,"date","dateid","select date");
BindDropdownList("select * from tblmonth",ddlDate,"month","monthid","select Month");
BindDropdownList("select * from tblYear",ddlYear,"Year","Yearid","select Year");
//To Bind DropdownList
        public DropDownList BindDropdownList(string qryInput, DropDownList dropdownId, string dataTextField, string dataValueField, string zerothIndexField)
        {
            try
            {
                con = OpenConnection();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = con;
                cmd.CommandText = qryInput;
                dropdownId.DataSource = cmd.ExecuteReader();
                dropdownId.DataTextField = dataTextField;
                dropdownId.DataValueField = dataValueField;
                dropdownId.DataBind();
                dropdownId.Items.Insert(0, zerothIndexField);
                CloseConnection();
                return dropdownId;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
  rami replied to Nowshad M
15-Nov-10 05:55 AM
hi,
  i have given like this when the user login with his username.
  
protected void btnLogin_Click(object sender, EventArgs e)
    {
      string strPwd;
      SqlConnection conn = new SqlConnection("Server=RAMINAIDU2-PC;DATABASE=Yaxis;User ID=sa;password=acuvate@123");
      conn.Open();
      SqlCommand cmd = new SqlCommand("select password from Registration where UserName='" + txtUsername.Text + "'", conn);
      strPwd = (string)cmd.ExecuteScalar();
      if (txtPassword.Text == strPwd)
      {
        Response.Redirect("homepage.aspx");
      }
    }


but when the user wants to login with his email then he wil put a tick in checkbox provided and he can login through that, then wats the code i have to write in 
 protected void cbLoginusingemail_CheckedChanged(object sender, EventArgs e)
    {
      ???????????
    }
  Nowshad M replied to rami
15-Nov-10 06:13 AM
Hi,
Do not write anythin in the checked change event

Write like the below code

 protected void btnLogin_Click(object sender, EventArgs e)
    {
        string strPwd;
        SqlConnection conn = new SqlConnection("Server=RAMINAIDU2-PC;DATABASE=Yaxis;User ID=sa;password=acuvate@123");
        conn.Open();
        SqlCommand cmd = null;
        if(cbLoginusingemail.Checked==false)
            cmd = new SqlCommand("select password from Registration where UserName='" + txtUsername.Text + "'", conn);
        else
            cmd = new SqlCommand("select password from Registration where EmailID='" + txtEmailID.Text + "'", conn);
        strPwd = (string)cmd.ExecuteScalar();
        if (txtPassword.Text == strPwd)
        {
            Response.Redirect("homepage.aspx");
        }
    }
  rami replied to Nowshad M
15-Nov-10 09:12 AM
hi nowshad,
    i have done the same wat u said
 but i am getting the error like "Error 3 The name 'txtEmailID' does not exist in the current context ". Because email is in other page.
what should i do now?
  Nowshad M replied to rami
15-Nov-10 11:09 PM
Hi,
txtEmailID This is the ID of the Textbox in which the user will enter Email Address..
  rami replied to Nowshad M
15-Nov-10 11:35 PM
hi,
  when the user enters the username in the registration form then an information must be given to the user whether the username is available or not. how to write code for this or wat should we use for this
  Nowshad M replied to rami
15-Nov-10 11:37 PM
Hi,
After entering the user name in the textbox just check if the same user name is availabl in dtabase. If available give a message to the user saying user name not available..
  rami replied to Nowshad M
15-Nov-10 11:38 PM
please help me with the code
  Nowshad M replied to rami
15-Nov-10 11:55 PM
Hi,
Try this code

protected void txtUserName_TextChanged(object sender, EventArgs e)
    {
        string connStr = ConfigurationManager.ConnectionStrings["conn"].ToString();
        SqlConnection conn = new SqlConnection(connStr);
        conn.Open();
        string query = "select count(*) from Registration where username='"+ txtUserName.Text+"'";
        SqlCommand dCmd = new SqlCommand(query, conn);
        SqlDataAdapter da = new SqlDataAdapter(dCmd);
        DataTable dt = new DataTable();
        da.Fill(dt);
        conn.Close();
        if (dt != null && dt.Rows.Count > 0)
            lblMessage.Text = "User Name already exists";
        else
            lblMessage.Text = "User Name availabe";
    }
  rami replied to Nowshad M
18-Nov-10 02:59 AM
hi,
 i am using a external css file in all my registration forms so that i can change styles to all pages at a time.
here i am having 4 columns in each form and their widths are different. how can i set different widths to different columns in css file? please tell me wat to do?
GRIDVIEW  GRIDVIEW
03-Dec-10 02:11 AM
Hi Nowshad,

how can i get a new row in grid view?
i am having a single column in which i have 4 dropdowns with four choices in each dropdown.
now when the user opens the page he will be provided with the page where the column name and one row of dropdown is visible and if he wants to select one more choice then on clicking certain link like insert new row , a new row must be provided to him so that he can select one more choice.
so i want to give the user to extend the number of rows upto 4.
how can i get this with gridview?
please help me with necessary coding.....
gridview  gridview
03-Dec-10 02:11 AM
HI,

how can i get a new row in grid view?
i am having a single column in which i have 4 dropdowns with four choices in each dropdown.
now when the user opens the page he will be provided with the page where the column name and one row of dropdown is visible and if he wants to select one more choice then on clicking certain link like insert new row , a new row must be provided to him so that he can select one more choice.
so i want to give the user to extend the number of rows upto 4.
how can i get this with gridview?
please help me with necessary coding.....
Page crash  Page crash
23-Dec-10 01:27 AM
hi,
  in my web application when i enter the text like <m , then immediately my page is being crashed.
So wat should i do to make my application not being crashed. Please give me any idea soon
page crash  page crash
23-Dec-10 01:27 AM
hi,
  in my web application when i enter the text like any character immediately after less than symbol like  <m , then immediately my page is being crashed.
So wat should i do to make my application not being crashed. Please give me any idea soon
  rami replied to rami
20-Jun-11 03:02 AM
Hi,

I am having a page like inside gridview i have checkbox for each row. And outside gridview i have two buttons like Approve and Reject. When i click on Approve i am getting an confirmation alert like "Do u want to approve or not?" . This i am getting because i have given in onclientclick as onclientclick="return confirm('Do u want to approve or not?');".

But if no checkbox is checked in gridview and if they click on Approve / Reject button then also they are getting confirmation alert. If no checkbox is checked they should get a message like "Please select atleast one record" instead of confirmation alert when they click on Approve/Reject button.

Please give reply as soon as possible.

Thanks in advance  

  rami replied to rami
20-Jun-11 03:21 AM
Hi,

I am having a page like inside gridview i have checkbox for each row. And outside gridview i have two buttons like Approve and Reject. When i click on Approve i am getting an confirmation alert like "Do u want to approve or not?" . This i am getting because i have given in onclientclick as onclientclick="return confirm('Do u want to approve or not?');".

But if no checkbox is checked in gridview and if they click on Approve / Reject button then also they are getting confirmation alert. If no checkbox is checked they should get a message like "Please select atleast one record" instead of confirmation alert when they click on Approve/Reject button.

Please give reply as soon as possible.

Thanks in advance  

Alert Message  Alert Message
20-Jun-11 03:21 AM
Hi,

I am having a page like inside gridview i have checkbox for each row. And outside gridview i have two buttons like Approve and Reject. When i click on Approve i am getting an confirmation alert like "Do u want to approve or not?" . This i am getting because i have given in onclientclick as onclientclick="return confirm('Do u want to approve or not?');".

But if no checkbox is checked in gridview and if they click on Approve / Reject button then also they are getting confirmation alert. If no checkbox is checked they should get a message like "Please select atleast one record" instead of confirmation alert when they click on Approve/Reject button.

Please give reply as soon as possible.

Thanks in advance  

Alert Message  Alert Message
20-Jun-11 03:22 AM
Hi,

I am having a page like inside gridview i have checkbox for each row. And outside gridview i have two buttons like Approve and Reject. When i click on Approve i am getting an confirmation alert like "Do u want to approve or not?" . This i am getting because i have given in onclientclick as onclientclick="return confirm('Do u want to approve or not?');".

But if no checkbox is checked in gridview and if they click on Approve / Reject button then also they are getting confirmation alert. If no checkbox is checked they should get a message like "Please select atleast one record" instead of confirmation alert when they click on Approve/Reject button.

Please give reply as soon as possible.

Thanks in advance  

Create New Account
help
Re : Excel Hyperlink to Open an External File Excel Re : Excel Hyperlink to Open an External File 01. Enter an Excel (version 2000) WorkSheet and construct a clickable hyperlink as follows :- = Hyperlink("C: \ Apps \ West \ Glycol Regeneration Package \ 1061-L-DW-402-3 SHT. 1.pdf", "Click") 02 Upon activation of the given hyperlink, the .pdf drawing file opens as desired. 03. Then, construct another hyperlink (leading to an
NET .NET Framework FOR EXAMPLE IF WE HAVE A HYPERLINK THAT HYPERLINK IS TRANSFERRED TO ANOTHER PAGE AND THAT PAGE CONTAINS SOME DATA THE QUERY IS HOW THE DATA IS TRANSFERRED TO DATABASE WITH TH AVAILABLE DATA WHEN WE CLICKING THE HYPERLINK. C# Discussions ASP.NET (1) Database (1) Gehenna (1) Konrad (1) Johnny (1) Gloria (1) Mike t your first language, but could you please explain a bit more clearly what you're trying to do and what the problem is. . . Also, please switch off your Caps Lock question is so vague as to be unintelligible. This is a newsgroup for discussing the C# programming language. If you don't understand the basics of http and databases, you'd me for other men. I yearn for you. I have no feelings whatsoever when we're apart. I can be forever happy-will you let me be yours? Gloria Dear John me. For other men, I yearn. For you, I have no feelings whatsoever. When we're apart, I can be forever happy. Will you let me be? Yours, Gloria - - Pete = = = = http
enable re-code to re-read on re-hidden columns, if can be possible Excel Hello again, I have this so good macro macro without hiding any columns, the results are perfect. When I hide cols. A, B, C & D. I do not realize that repetitive data keeps building (Col A, B, C & D) up everytime I click the macro - which should not work like this as intended had made errors during the copy-paste of the code. please help. . herebelow is the re-code again - - Sub GetFileDetails() Dim fso As Object, folder As Object Dim lngRow As Long Find(fl.Name, LookAt: = xlPart) If rngFound Is Nothing Then ws.Range("A" & lngRow).Formula = " = hyperlink(""" & _ folder.Path & " \ " & fl.Name & """, """ & fl.Name & """)" ws.Range("B" & lngRow) = fl.Size ws.Range("C" & lngRow) = fl.DateLastModified ws.Range("D" & lngRow) = "New" lngRow = lngRow + 1 Else If ws.Range
public / english / protection / safework / cis / products / icsc / dtasht / _icsc05 / icsc0553.htm each chemical has a hyperlink to its own web page like this one. Let me know what you think Best End With 'move data from tempory sheet to chemical sheet TempRowCount = 17 Do While Range("C" & TempRowCount) <> "" ChemicalSht.Range("A" & ChemicalRowCount) = _ TempSht.Range("C" & TempRowCount) ChemicalRowCount = ChemicalRowCount + 1 TempRowCount = TempRowCount + 1 Loop Next i TempSht.Cells.ClearContents End Sub in IE.Document.All Range("A" & RowCount) = itm.tagname Range("B" & RowCount) = itm.classname Range("C" & RowCount) = itm.innertext RowCount = RowCount + 1 next itm Note: innertext can sometimes by very long each itm in ClassB Range("A" & RowCount) = itm.tagname Range("B" & RowCount) = itm.classname Range("C" & RowCount) = itm.innertext RowCount = RowCount + 1 next itm 3) I also you break point and Use ICSC: to get chemical names With Sheets("Temp") DataSht.Range("A" & RowCount) = Chemical Set c = .Columns("B").Find(what: = "ICSC:", LookIn: = xlValues, lookat: = xlPart) If c Is Nothing Then MsgBox ("Error - Could not find ISCS for Chemical : " & Chemical) Stop Else 'Move Generic Name DataSht.Range("B" & RowCount) = c.Offset(0, -1).Value End If 'Use ISCS Number to find first Row of Alternate
Mailmerge and Hyperlinks Word When trying to automate a hyperlink to incorporate a code from a mailmerge document, the hyperlink won't change. A mailmerge field, is : {MERGEFIELD(text / code) * \ MERGEFORMAT} A hyperlink is: {HYPERLINK(website) * \ MERGEFORMAT} however, if you direct the hyperlink to the mergefield, it doesn't work, I know this is due the address specified when first creating the hyperlink, but is there a way of tricking word into automatically updating the hyperlink, based on the merge code? - - ProS Word Mail Merge Fields Discussions Word (1) MailMergeBeforeRecordMerge (1 1) WithEvents (1) Mailmerge (1) Configurable (1) If you are trying to create something like {Hyperlink "{Mergefield WebAddress}"} then merge to a new document, select the document and press F9 to