|
Have a look at this article[^] on codeproject, it shows you how to create dynamic controls. This msdn[^] shows you how to add controls to a place holder.
In the click event of the button, split the filenames into an array, for every item in the array create a linkbutton with a click event and add it to the placeholder
ex:
LinkButton link;
for(int i = 0; i <= FileNames.Length-1 ; i++)
{
link = new LinkButton();
link.ID = "link"+i.ToString();
link.Text = "http://www.yoursite.com/uploadedfile/"+ FileNames[i];
link.Click += new EventHandler(link_Click);
PlaceHolder1.Controls.Add(link);
}
Instead of the linkbutton you can also use the label control and set the text of the label control as Label1.Text = a href to pass the location to it.
This is just a sample code, just change it to how you need it. You will have to ensure that the controls get added back when a postback takes place.Last modified: 16mins after originally posted --
|
|
|
|
|
Thank you, and I am glad your willing to help such a newb like myself, but believe me, I am trying to help myself at the same time. Thanks for links to articles on this, will most definately read. I found some good help in my Visual C# .Net book as well.
|
|
|
|
|
Both links went to code project
|
|
|
|
|
Sorry. I Have changed it now, have a look.
|
|
|
|
|
This is going to be great for my upload on my main form that they upload on, but for the page I am doing this on, its just to view, they will not be allowed to upload any files, just vewing files attached to a helpdesk record.
|
|
|
|
|
Just pass the string to the required page or store it and retrieve it from some location and do the same thing.
|
|
|
|
|
I am trying to write a dataset upon login and write certain information retrieved from an Access db (I hate Access but right now the SQL box isn't available so I'm hitting the Access db as little as possible). When I populate the DataSet and use DataSet.WriteXML it's giving weird results. Also, when I login in a 2nd time (with a different user, the only part that works is searching the XML for the user I'm logging in with if it exists then dont rewrite it) I want it to append it to the existing XML document and even this isn't working right, the .WriteXML is giving a result like
<newdataset>
<Table>
<_x0027_u_name_x0027_>rlmccutchen<_x0027_u_name_x0027_>
<_x0027_u_pwd_x0027_>*********<_x0027_u_pwd_x0027_>
<_x0027_f_name_x0027_>Richard<_x0027_f_name_x0027_>
<_x0027_l_name_x0027_>McCutchen<_x0027_l_name_x0027_>
<_x0027_email_x0027_>richard@psychocoder.net<_x0027_email_x0027_>
<_x0027_is_admin_x0027_>1<_x0027_is_admin_x0027_>
<_x0027_total_posts_x0027_>0<_x0027_total_posts_x0027_>
<_x0027_client_id_x0027_>1<_x0027_client_id_x0027_>
<_x0027_user_id_x0027_>1<_x0027_user_id_x0027_>
<_x0027_site_name_x0027_>RamEngine<_x0027_site_name_x0027_>
</Table>
</newdataset>
<newdataset>
<Table>
<_x0027_u_name_x0027_>jbunton<_x0027_u_name_x0027_>
<_x0027_u_pwd_x0027_>*********<_x0027_u_pwd_x0027_>
<_x0027_f_name_x0027_>Jack<_x0027_f_name_x0027_>
<_x0027_l_name_x0027_>Bunton<_x0027_l_name_x0027_>
<_x0027_email_x0027_>ramremfg@aol.com<_x0027_email_x0027_>
<_x0027_is_admin_x0027_>0<_x0027_is_admin_x0027_>
<_x0027_total_posts_x0027_>0<_x0027_total_posts_x0027_>
<_x0027_client_id_x0027_>1<_x0027_client_id_x0027_>
< _x0027_user_id_x0027_>2<_x0027_user_id_x0027_>
<_x0027_site_name_x0027_>RamEngine<_x0027_site_name_x0027_>
</Table>
</newdataset>
I've been raking my head for days now trying to solve this so I canh move on to a new piece. Can someone please help.
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
RLMcCutchen wrote: When I populate the DataSet and use DataSet.WriteXML it's giving weird results.
Like what?
RLMcCutchen wrote: Also, when I login in a 2nd time (with a different user, the only part that works is searching the XML for the user I'm logging in with if it exists then dont rewrite it) I want it to append it to the existing XML document and even this isn't working right, the .WriteXML is giving a result like
Are you using a stream or directly writing it into a file? Looks like you are opening a filestream writing the file and opening the file again and appending the 2nd user's data, in this scenario the xml will get appended to the previous xml in the file.
If you post the code you are using, then we could find out the problem.
|
|
|
|
|
Tarakeshwar Reddy wrote: RLMcCutchen wrote:
When I populate the DataSet and use DataSet.WriteXML it's giving weird results.
Like what?
The weird results are the XML I posted in the original post. The column names arent what they are coming from the database. Granted I dont do a lot of work with XML and I've spent some time researching it but I feel like I'm beating my head against the wall. Once I get home I'll post the code but right now I'm at work and dont have access to my home development machine.
Part 2
I do want the XML appended but the way its doing it its adding a 2nd root element which cant happen so I'm trying to figure out how to add the other users as they login without adding multiple root level elements.
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
RLMcCutchen wrote: I do want the XML appended but the way its doing it its adding a 2nd root element which cant happen so I'm trying to figure out how to add the other users as they login without adding multiple root level elements.
How are you adding the users? From your code I presume that you have a dataset which would already contain the details of the first user, if you add a new row to the dataset and fill it with the required details and then do a writexml you should be having an xml file with a single root element and both the users details inside it. Looks like the logic your using is different from the one I have mentioned and thats why your getting multiple root elements.
Once you get back home, you can post the code and we could find out the issue.
|
|
|
|
|
I have no problem while coding ASP.Net page but when it comes to create an attractive page in terms of look and feel ( i am a failed man). I donot know how we can graphically design a web page in visual studio 2005(ASP.Net). For e.g. i have 3 images; how can i shown these pages in the head,middle and foot of a ASP.Net page.
Also,please provide some good links for grahically desiging a ASP.Net page if possible.
X
|
|
|
|
|
My name is Jatinder and I work for Microsoft on the TechEd event. I generally read IT blogs to keep up with what is going on in the industry and decided to jump on in with a little plug for TechEd 2007 (June 4 – 8). This year we’ve dedicated 50% of the event content to developer specific tools with deep technical training that covers Visual Studio® 2005, Windows Vista™ development and the .NET Framework. You can also get in-depth information on building software using Visual C++®, Visual Basic® and Visual C#®. The incredible amount of information you can learn at TechEd is awesome but it is also an incredible place to network and let loose a little. The event is in Orlando, FL this year so the attendee party is at Universal Studios Islands of Adventure and the place is reserved for TechEd attendees only! Trust me, these parties are a blast. If you decide to go you should register now before it sells out like it did last year…we are also offering a bit of an incentive, all registrations before May 11th are entered to win either 1 of 5 Xbox 360 Elites (killer graphics) or 1 of 5 Amex gift cards (Disney ain’t cheap!) www.microsoft.com/teched
Jatinder Singh
|
|
|
|
|
Whats wrong with you? This is the 4th time your posting this message. I am sure Microsoft doesn't have people who spam the forums like this. Kyle please stop this
|
|
|
|
|
i have created a number of combo boxes according to my need.no i want to save the changes when any one click update button,but here the control did not find by findcontrol function.
Dim i, j, totc As Long, FcNo As String, cmbcat As Object, fid As ArrayList
catarry = New ArrayList
catarry = CType(ViewState("catgs"), ArrayList)
totc = CLng(ViewState("totcts"))
For i = 0 To totc - 1
'for category combo box
'cmbcat = New Object
'cmbcat = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList)
'cmbcat = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList)
'cmbcat = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList)
If Not CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList) Is Nothing Then
FcNo = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList).Text
End If
StrQry = "update category set cat_order=" & FcNo & " where cat_no=" & "catpp" & catarry(i * 3 + 1)
'Now check for all forums of category
fid = New ArrayList
fid = AllFunctions.PopToarraylist("select Forum_No from Forum where cat_no=" & catarry(i * 3 + 1), 1)
For j = 0 To fid.Count - 1
cmbcat = New Object
'cmbcat = CType(FindControl("frmpp" & fid(i)), DropDownList)
'cmbcat = CType(FindControl("frmpp" & fid(i)), DropDownList)
'cmbcat = CType(FindControl("frmpp" & fid(i)), DropDownList)
If Not CType(Me.FindControl("frmpp" & fid(i)), DropDownList) Is Nothing Then
FcNo = CType(FindControl("frmpp" & fid(i)), DropDownList).Text
End If
'cmbcat.Text
StrQry = "update Forum set Forum_Order=" & FcNo & " where forum_no=" & fid(i)
AllFunctions.UpdateQry(StrQry)
Next
Next
|
|
|
|
|
I am using a GridView and i connected it to an SqlDataSource to display data, but the data i want to display is from multiple tables and the GridView lets u select data just from one table, How can i solve this porblem.
Thanx in advance for ur help
yasso
|
|
|
|
|
You would need to query the data together. Why are arent you just specifying your datasource in your webconfig file, loading the datasource, and then querying out what you need with a SQL statement?
|
|
|
|
|
I have a textbox that should be validated thats on a webcontrol.
The webcontrol is on a step in a wizard control.
When I click the next button the validation for the textbox does not fire.
Is there a way to make the validation just for the webcontrol on the step in focus fire ?
|
|
|
|
|
Hi friends
I have one string str="aaaa,bbbb,cccc,dddd,eeee,ddddd";
I want to count char "," from the above string
plz any one help me
thanks in advance
pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Imran Khan Pathan wrote: I want to count char "," from the above string
Means you want to count number of comma or words in that string .
i have solution for counting chars in the string excluding , . and space
<br />
string str = "edasdsadsadasda,..sdasdasd..asdsad";<br />
char[] sep={',',' ','.'};<br />
string[] strArray= str.Split(sep,StringSplitOptions.RemoveEmptyEntries);<br />
int length = 0;<br />
foreach (string SingleString in strArray)<br />
{<br />
length += SingleString.Length;<br />
}<br />
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Just count them:
int cnt = 0;<br />
foreach (char c in str) if (c == ',') cnt++;
---
single minded; short sighted; long gone;
|
|
|
|
|
As per our requirement i have created a word report with password.
And i am exporting it to the client system.
It works fine in some system. But in some client system the gif files are not correctly loaded. For the same when checked up in the Server the images are correctly loaded(i commented the code of deleting the file at the server). But there is some problem while exporting the same to the client Ip.
Actually while creating the document at the server i am inserting a table containing that gif images also with some formatted headningd in it....
And that table is made as a header for the word document...
I am just not able to figure out...what could be the problem ?
If any body could provide any tips or suggestion i can sychronize that code with thread....because of this that is getting pending....
Please help....
-- modified at 9:19 Friday 4th May, 2007
|
|
|
|
|
while do sorting the header becomes hyperlink so we click and sorting is achieved .But i dont want it to become hyperlink .Instead i want the colour of
the font to change or anything apart from hyperlink. can anyone help me out it is urgent.
Thanks in advance.
|
|
|
|
|
Well then you need to create a template column. Edit the header cell with your own control and then add code behind to sort.
|
|
|
|
|
please tell me how it is done. any links exhibiting how it can be done.
thanks
-- modified at 9:26 Friday 4th May, 2007
|
|
|
|
|
Can some body help me with the steps for deployment of a webapplication.
Thanks........
|
|
|
|