|
Instead of label you can use a LiteralControl
LiteralControl lit=new LiteralControl();
lit.Text="<br />"
Textboxhere.controls.add(lit);
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
modified on Tuesday, July 8, 2008 11:04 AM
|
|
|
|
|
I am pasting the complete code:
foreach (DataRow row in dataSetselect.Tables[0].Rows)
{
lb = new Label();
tb = new TextBox();
lb.Text = "<br />" + row["field"].ToString();
tb.Text = row["field"].ToString();
TextBoxesHere.Controls.Add(lb);
TextBoxesHere.Controls.Add(tb);
}
Is it the same code as what you are using?
|
|
|
|
|
OK I got it now, I was putting the break in the textbox not the label!!
Thanks for your help in this
|
|
|
|
|
hi
i want to store static ip address to my database because if any one upload a video form their machine at any country i have to know this uploaded file uploaded by which ip and which country
so how to get static ip address
please help me
with regards,
bretto
|
|
|
|
|
Page.Request.UserHostAddress.ToString();
is this you was looking for ?
|
|
|
|
|
How we can Modify the Gridview Caption Style ?
|
|
|
|
|
see if this article helps:
http://www.velocityreviews.com/forums/t113102-gridview-caption-style.html
|
|
|
|
|
I have the following code. Now this code is working for every row apart from the last one in the gridview, why would this be?
thanks
for (int x = 0; x < GridView1.Rows.Count; x++)
{
GridViewRow row = GridView1.Rows[x];
string strID = GridView1.DataKeys[x].Values[0].ToString();
HyperLink hyp = ((HyperLink)row.FindControl("hl"));
hyp.Attributes["OnClick"] = "alert('You do not have the correct permissions to perform this action');return false;";
hyp.ForeColor = Color.Black;
}
|
|
|
|
|
Fixed it, needed to put this code in the ondatabound event rather then on row create event
cheers
|
|
|
|
|
You mean to say that you are looping through all the rows of the gridview inside rowdatabound event?
Apurva Kaushal
|
|
|
|
|
|
I don't know why are you using like that becauise onrowdatabound event gets executed for all the rows of the gridview and if inside that event again if you are looping through all the rows then it seems unnecessary and also will cause a performance issue.
Apurva Kaushal
|
|
|
|
|
Hi,
I am checking users on my page load. If my condition fails, I have to stop the page loading and I dont want to display any of my controls too. For this purpose, I dont want to redirect my page. What I have to do. What about response.End
If I use response.end, I am getting error msg as "cannot obtain value". What I have to do?. Pls help.
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: dont want to redirect my page.
Ohh- redirecting to other page is a neat solution.
Put two panels, first panel contains all your controls and second one contains your error message which will be displayed when condition fails. Now toggle these panels visibility after checking the condition.
|
|
|
|
|
Thank you..
Balasubramanian K.
|
|
|
|
|
Hi,
you can put all of your controls inside a div and set it's visibility depending up on your condition.
<div runat="SERVER" id="divFull">
controls
</div>
divFull.Visible = condition;
Regards
Nirandas,
a developer from India.
|
|
|
|
|
Thanks for your reply..
Balasubramanian K.
|
|
|
|
|
Hi All,
Can you please share me the code to download file in ASP.net
Thanks in Advance
|
|
|
|
|
Kumar002 wrote: Can you please share me the code to download file in ASP.net
No
What do you mean download a file from sql server? you mean from the database yeah?
Do you want this to be a function that your users can perform?
|
|
|
|
|
try this code. i assume that file is stored in binary form in sqlserver
Const SQL As String = "SELECT * FROM Pictures where id=8"
Dim myCommand As New SqlCommand(SQL, con)
con.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader
If myReader.Read Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + myReader("FileName"))
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(myReader("ImageData"))
Response.End()
End If
myReader.Close()
con.Close()
|
|
|
|
|
Thanks for your reply,
I need to list all the files from that directory and from that list i should give a option to download the respective files.
actuvally i am a biginner so i dont have other chioce thatn posting these if you can give me an ex that wouls be great.
|
|
|
|
|
Kumar002 wrote: I need to list all the files from that directory
Use Directory.GetFiles() method. If you just provide a link to the file, it gets downloaded.
|
|
|
|
|
.fixedHeader
{
overflow: auto;
height = 10px
}
table th
{
position: relative;
top: expression(this.parentNode.parentNode.
parentNode.scrollTop-1);
}
using this css iam able to get the fixed header for my grid but the problem is that iam having a grid with the panel out side .. the grid view header is getting fixed but it going over the panel start point where it is not looking nice how to get the grid header with in the panel ..
|
|
|
|
|
and what is your question?
|
|
|
|
|
hii
Can anyone tell me which reference or namespace i use for ConfigurationNamingContext. my code is as below:-
Private Function ResolveNetBiosNameToDN(ByVal netbiosName As String) As String
Try
Return DirectCast(GetDirectoryEnTry(String.Format("CN={0}, CN=Partitions, {1}", netbiosName, DirectCast(ConfigurationNamingContext.Properties("distinguishedName").Value, String))).Properties("nCName").Value, String)
Catch ex As System.Runtime.InteropServices.COMException
If CInt(ex.ErrorCode) = 2147950640 Then
Throw New ArgumentException("The given netbios name was invalid", "netbiosName", ex)
Else
Throw
End If
End Try
End Functio
|
|
|
|