|
Hi,all
i have created table Dynamically , and added the linkbutton control to table cells using the folowing code
Dim noOfTimes As Integer = 0
dim CurrentName As String = Nothing
Dim trow As TableRow = New TableRow
For d = 0 To 31
Dim tbcell As TableCell = New TableCell
'Iterate to see which cells have a booking against a name
If testarray(d) = Nothing Then
'No booking case
CurrentName = Nothing
tbcell.BackColor = Color.Yellow
Else
'booking exists, find noOfTimes it is booked for same employee
CurrentName = testarray(d)
'search subsequent entries for same name
for j = d+1 to 31
'
if testarray(j) = CurrentName then
'same name repeated
noOfTimes = noOfTimes + 1
else
'name is not repeated, print name and advance d counter by number of times
Response.Write(" Span of " + noOfTimes.ToString() + " " + CurrentName )
d = d + noOfTimes
noOfTimes = 0
'exit for loop using the statement below
exit for
end if
next
'Here i added linkbutton code like
Dim lnbutton as linkbutton = new linkbutton
lnkbutton.text ="Click Here"
lnkbutton.postbackurl=""
tblcell.controls.add(lnkbutton)
tbcell.BackColor = Color.Green
tbcell.ColumnSpan = noOfTimes
End If
tbcell.Text = " "
trow.Cells.Add(tbcell)
Next
Table1.Rows.Add(trow)
Next
Linkbutton control is not added to table cells
Please suggest me where iam doing mistake and where i have to put linkbutton code .
any article or help is highly appericated.
Best Regards
Rameez
Thanks in advance
|
|
|
|
|
Easy method is to use DataGrid/GridView. Put a template column and add the link button to there. If you need to add new rows, create new row in the datasource and rebind the grid. This is easy and ASP.NET will take care about maintaining viewstate.
|
|
|
|
|
Thanks for reply,
i donto understand ur answer how i solve my problem .
kindly suggest me how i add linkbutton control to table cell and where i have to put code of that in my defined code .
Regards
Rameez
|
|
|
|
|
I was suggesting the same table can be made using a GridView without any effort. GridView/DataGrid renders as normal table.
|
|
|
|
|
I have hit a strange problem. I have one application deployed on 2 different websites. They both access the same database. The connection string in the web.config is same.
The problem is that on one website I have started getting 'Connection Timeout' message. This website has stopped completely and I keep getting timeout error. I have ConnectionTimeout = 1000 in my code.
However, on the second website, the same application is able to connect to DB without any problem. So I am not sure why one website is able to connect to a DB and another cannot.
Any thoughts on this please.
Thanks
|
|
|
|
|
which databse u use?
Darshana Pathak
|
|
|
|
|
Shared (hosted) MS SQL Server 2000
|
|
|
|
|
is it working successfully with another website Simulteneously?
Check one by one it can be possible that if one is using that connection so other may not be able to access.
Or check your web.config file that u have written correct server name & database name.
Darshana Pathak
|
|
|
|
|
Hi,
I am developing an secure website,My problem when i login to my site it should not ask for remembering the paasword although in the browser settings it is enabled for prompting to ask for saving the user and password.
Cheers!!
Brij
|
|
|
|
|
It is not possible to override browser settings from your code... as per I know..
But what you can do is just use Form Based Authentication, and go cookieless...
Abhishek Sur
|
|
|
|
|
Hi Abhishek,
Thanks for your answer. as i am also searching for this soluation.
Abhishek sur wrote: But what you can do is just use Form Based Authentication, and go cookieless.
Can you be more specific on that or can you give me some more details?
Thanks in advance !!!
|
|
|
|
|
Actually there are some applications that is integrated to my apllication that requires cookies.So i have to use cookies.
Cheers!!
Brij
|
|
|
|
|
Yes u can change browser settings
Internet Options==>Contenet==>AutoComplete==>Prompt me to save passwords
Darshana Pathak
|
|
|
|
|
Hi reader,
I need the code for "Export the Data from gridview to Excel".And on the Excel sheet the data's particular column should have backcolor and Font bold, like that.
Can anybody help me?
|
|
|
|
|
There are a lot of articles in CP that illustrates how to export to excel:
Export to Excel[^]
|
|
|
|
|
Hi,
I have a solution that contains 3 projects.
all of the projects use the same pictures so I put them in a directory at the same lavel of the solution.
when I try to access a picture I give the relative path ../pictures/picture1.jpg
but I got the following error "Cannot use a leading .. to exit above the top directory."
Please HELP!!
Thanks
|
|
|
|
|
Please try ~/ instead of ../.
Hope it will solve your problem
Cheers!!
Brij
|
|
|
|
|
it's doesn't work.I can't do this because it's not on the the same folder that the project.It's in the folder of the solution.
thanks.
|
|
|
|
|
lune12 wrote: I can't do this because it's not on the the same folder that the project.It's in the folder of the solution.
thanks.
Do you mean that it is not in your your virtual directory? If that is the case you have you have to use a VD for those images and use full http path to the image. for example http://localhost/ImageVD/image1.jpg
or
just copy that damn image to you VD
|
|
|
|
|
Hello,
please help me. How I can enable Assembly binding logging. I have VS2008 and SDK 6.1. I modify my registers - add HKLM\Software\Microsoft\Fusion!EnableLog and set 1. I have set Fusion Log Viewer to "Log all binds to disk" and custom directory. But it doesnt still work. On yellow-screen-of-death I see warn:
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Thanks for all comments
Bye
Marek from Czech
|
|
|
|
|
Hi All,
I have a valid xml loaded in to XmlDocument object. How can I retrieve values from it, can any body please help me in it if possible give me a small code snippet or any link.
<Parameter>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
<Value Name="Aleem" Length = "0" Type="System.String">0</Value>
</Parameter>
Thanks for the help,
Aleem Mohammad,
NIIT technologies
abdul.aleem@niit-tech.com
|
|
|
|
|
This One[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks a Lot friend.
NIIT technologies
abdul.aleem@niit-tech.com
|
|
|
|
|
if (var_bcard != "")
{
Response.ContentType = "plain/text";
Response.Write("Hello Profile" + " " + Request.Form["var_bcard"] + " ");
String counterFile11 = Server.MapPath("bcard.xml");
if (File.Exists(counterFile11))
{
File.Delete(counterFile11);
}
StreamWriter sw11 = File.CreateText(counterFile11);
sw11.WriteLine(var_bcard);
sw11.Close();
}
string command1 = "",key1="",id2="", id1 = "", name1 = "", title1 = "", company1 = "", resstreet1 = "", rescity1 = "", resstate1 = "", respostalcode1 = "", rescountry1 = "", officestreet1 = "", officecity1 = "", officestate1 = "", officepostalcode1 = "", officecountry = "", worktel1 = "", worktel2 = "", hometel1 = "", hometel2 = "", mobile1 = "", fax1 = "", email1 = "", website1 = "";
XmlDocument doc1 = new XmlDocument();
doc1.Load(MapPath("bcard.xml"));
XmlNodeList mykey = doc1.GetElementsByTagName("Command");
command1 = mykey.Item(0).InnerText;
XmlNodeList mykey1 = doc1.GetElementsByTagName("Key");
if (mykey1.Count > 0)
{
key1 = mykey1.Item(0).InnerText;
}
else
{
key1 = "";
}
XmlNodeList mykey2 = doc1.GetElementsByTagName("Id");
if (mykey2.Count > 0)
id1 = mykey2.Item(0).InnerText;
else
id1 = "";
XmlNodeList mykey3 = doc1.GetElementsByTagName("Name");
if (mykey2.Count > 0)
name1 = mykey3.Item(0).InnerText;
else
name1 = "";
XmlNodeList mykey4 = doc1.GetElementsByTagName("Title");
if (mykey4.Count > 0)
title1 = mykey4.Item(0).InnerText;
else
title1 = "";
XmlNodeList mykey5 = doc1.GetElementsByTagName("Company");
if (mykey5.Count > 0)
company1 = mykey5.Item(0).InnerText;
else
command1 = "";
XmlNodeList mykey6 = doc1.GetElementsByTagName("resStreet");
if (mykey6.Count > 0)
resstreet1 = mykey6.Item(0).InnerText;
else
resstreet1 = "";
XmlNodeList mykey7 = doc1.GetElementsByTagName("resCity");
if(mykey7.Count>0)
rescity1 = mykey7.Item(0).InnerText;
else
rescity1 = "";
XmlNodeList mykey8 = doc1.GetElementsByTagName("resState");
if (mykey8.Count > 0)
resstate1 = mykey8.Item(0).InnerText;
else
resstate1 = "";
XmlNodeList mykey9 = doc1.GetElementsByTagName("resPostalcode");
if (mykey9.Count > 0)
respostalcode1 = mykey9.Item(0).InnerText;
else
respostalcode1 = "";
XmlNodeList mykey10 = doc1.GetElementsByTagName("resCountry");
if (mykey10.Count > 0)
rescountry1 = mykey10.Item(0).InnerText;
else
rescountry1 = "";
XmlNodeList mykey11 = doc1.GetElementsByTagName("officeStreet");
if (mykey11.Count > 0)
officestreet1 = mykey11.Item(0).InnerText;
else
officestreet1 = "";
XmlNodeList mykey12 = doc1.GetElementsByTagName("officeCity");
if (mykey12.Count > 0)
officecity1 = mykey12.Item(0).InnerText;
else
officecity1 = "";
XmlNodeList mykey13 = doc1.GetElementsByTagName("officeState");
if (mykey13.Count > 0)
officestate1 = mykey13.Item(0).InnerText;
else
officestate1 = "";
XmlNodeList mykey14 = doc1.GetElementsByTagName("officePostalcode");
if (mykey14.Count > 0)
officepostalcode1 = mykey14.Item(0).InnerText;
else
officepostalcode1 = "";
XmlNodeList mykey15 = doc1.GetElementsByTagName("officeCountry");
if (mykey15.Count > 0)
officecountry = mykey15.Item(0).InnerText;
else
officecountry = "";
XmlNodeList mykey16 = doc1.GetElementsByTagName("workTel1");
if (mykey16.Count > 0)
worktel1 = mykey16.Item(0).InnerText;
else
worktel1 = "";
XmlNodeList mykey17 = doc1.GetElementsByTagName("workTel2");
if (mykey17.Count > 0)
worktel2 = mykey17.Item(0).InnerText;
else
worktel2 = "";
XmlNodeList mykey18 = doc1.GetElementsByTagName("homeTel1");
if (mykey18.Count > 0)
hometel1 = mykey18.Item(0).InnerText;
else
hometel2 = "";
XmlNodeList mykey19 = doc1.GetElementsByTagName("homeTel2");
if (mykey19.Count > 0)
hometel2 = mykey19.Item(0).InnerText;
else
hometel2 = "";
XmlNodeList mykey20 = doc1.GetElementsByTagName("Mobile");
if (mykey20.Count > 0)
mobile1 = mykey20.Item(0).InnerText;
else
mobile1 = "";
XmlNodeList mykey21 = doc1.GetElementsByTagName("Fax");
if (mykey21.Count > 0)
fax1 = mykey21.Item(0).InnerText;
else
fax1 = "";
XmlNodeList mykey22 = doc1.GetElementsByTagName("EMail");
if (mykey22.Count > 0)
email1 = mykey22.Item(0).InnerText;
else
email1 = "";
XmlNodeList mykey23 = doc1.GetElementsByTagName("Website");
if (mykey23.Count > 0)
website1 = mykey23.Item(0).InnerText;
else
website1 = "";
mine xml is
<root><command>Create</command><id>0</id><name>a</name><title>a</title><company>a</company><resstreet>a</resstreet><rescity>a</rescity><resstate></resstate><respostalcode></respostalcode><rescountry></rescountry><officestreet>a</officestreet><officecity></officecity><officestate>a</officestate><officepostalcode></officepostalcode><officecountry></officecountry><worktel1>1</worktel1><worktel2>1</worktel2><hometel1>1</hometel1><hometel2>1</hometel2><mobile>1</mobile><fax>1</fax><email>a</email><website>a</website></root>
i think its helpful for you.
I will do my best?
|
|
|
|
|
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|