|
Please try with the CSS and display it in the front end. I hope that is one of the way.
Otherwise try to use object datasource and in the custom paging code it as to display page in the fron tend.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hello every one,
I'm working in a Wizard Control and on one of its WizardSteps I'm adding the link buttons in an ASP:Table control. The code is like this
<code>
{
TableRow tr = new TableRow();
TableCell td = new TableCell();
for (i = 0; i < oCat.DefaultView.Table.Rows.Count; i++)
{
if (i % t_col == 0)
{
tr = new TableRow();
CategoryTable.Rows.Add(tr);
}
LinkButton link = new LinkButton();
DataRow dr = oCat.DefaultView.Table.Rows[i];
link.Click += new EventHandler(linkPrimaryCategory_Click);
link.ID = oCat.ID.ToString();
link.Text = oCat.CatName;
td.Controls.Add(link);
tr.Cells.Add(td);
td = new TableCell();
oCat.MoveNext();
}
}</code>
my problem is that the list is being generated but the event handler I'm trying to add to the link button (shown in bold) isnt working. While debugging it doesnt go to that function at all. So what should I do?? Please give me ur suggestions, comments etc.
Thanks in advance
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
when you click on the Link button, and the page postbacks, does the button disappear,i.e are you loosing all the dynamically created controls at postback ? If so , you'll need to recreate the controls at each postback and that will solve your problem.
|
|
|
|
|
oh yes that's exactly what's happening. I loose the whole set of rows in the table.
Thanks
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
yeah, I faced the same problem once, I remember solving it by recreating the controls.
|
|
|
|
|
sorry there's another problem here. This table is in a WizardStep and I want to go to the next WizardStep when the user clicks the link. What this thing is doin right now is that it doesnt go to the next wizardstep
her's the code in the Page's load event
<code>if (IsPostBack)
{
int pid;
if (Request.QueryString["p_id"] != null && Int32.TryParse(Request.QueryString["p_id"].ToString(), out pid))
{
if (Wizard1.ActiveStep.Title.ToLower() == "select a category")
{
PCatIDHiddenField.Value = pid.ToString();
Wizard1.ActiveStepIndex = 2;
}
}
}</code>
The problem I see is that the Hyperlinks call the page all over again and it's not taken as a postBack so the wizard gets back to the start screen and I get no juice. Previosuly I tried to put a link button and register its Onclick event dynamically but that didnt work at all. Currently it looks like I'm preety much out of ideas except that I should let the idea of using a wizard go and make seperate forms that should work like a wizard.
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
I am not sure whats going on , but I just compiled a sample project and it worked:
I've created a create button function:
Private Sub CreateButton()
Dim oButton As LinkButton = New LinkButton()
oButton.Text = "My Button"
AddHandler oButton.Click, AddressOf Buttonclick
Dim oPlaceHoder As PlaceHolder = CType(Wizard1.FindControl("PlaceHolder1"), PlaceHolder)
oPlaceHoder.Controls.Add(oButton)
End Sub
I hooked the Click Event to this function:
Private Sub Buttonclick(ByVal sender As Object, ByVal e As EventArgs)
Label1.Text = "Button Clicked"
Wizard1.ActiveStepIndex = Wizard1.ActiveStepIndex + 1
End Sub
I am calling the CreateButton function on each page Load
<br />
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
CreateButton()<br />
End Sub<br />
Also Note that I am using a placeholder to hold the dynamically created button.And sorry for providing a VB.NET sample, I don not have C# installed on this PC.
|
|
|
|
|
YES Finally it worked!!
Thanks a bundle, I really appreciate ur help,
well I did as u were doin I had replaced the Linkbutton with hyperlinks while trying all sorts of things and now it has moved to teh next WizardStep and this one is now turning out to be empty, so I'm looking into that matter.
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Can somebody help in hosting an ASP.Net website in IIS
Thanks in advance
|
|
|
|
|
What kind of help are you looking for?
|
|
|
|
|
|
Get it
And before posting your questions please read the guidelines mentioned
in the forum. please make your Subject as proper don't make it as Hi.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Sure - there are any number of hosting companies out there. Google can help you find some.
|
|
|
|
|
Hi,
Please tell me how i can add text like "@ www.abc.com copyright" on the top of the image when user upload his image. uploaded image saved in the folder "UserImages" on the server.
Pleaseeeeeeeeeeeeee help me...
Thanks
Pooja vaidvan
|
|
|
|
|
|
Hello everyone
I want to phrase my problem in a new way that the following code works well on the same system on debugging mode of the project but If I want to copy the url of the project and paste into new browser window without debugging mode, then the problem arises that Its shows progressing the browse folder dialog box does not appears any how. So If any one have the solution of my problem please reply me soon....
I written earlier on this topic shown below...
---------------
I am facing a problem of browse folder. Its working fine on loacalhost but when I upload my project into my client's server, the browse folder dialog box does not appears any how. It giving no error but browser progress bar shows progressing....
Is the reason behind this is I have used Shell32.dll for browse folder.. Or there is another way of implementing browse folder functionality on my project..
Thanks
following is mine code
-------------------------------------------------------
Using shell32;
protected void AddFolder_Click(object sender, EventArgs e)
{
string strPath = "";
string strCaption = "Browse a directory for uploading Album.";
//DialogResult dlgResult;
string dlgResult = "";
Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0, strCaption, 0, System.Reflection.Missing.Value);
if (fld == null)
{
dlgResult = "Cancel";//DialogResult.Cancel;
}
else
{
strPath = fld.Self.Path;
lstboxFile.Items.Add(strPath);
//strPath = "albums\\MSN Home Page";
lstboxFile.Items.Add(strPath);
BaydonConstants.hif1.Add(strPath);
dlgResult = "Ok";//DialogResult.OK;
}
}
-------------------------------------------------------
Vishnu Narayan Mishra
Software Engineer
<div class="ForumMod">modified on Monday, December 17, 2007 7:16:26 AM</div>
|
|
|
|
|
This could be a permission issue related to your client's hosting company
|
|
|
|
|
What are those permission security issues..?? How can I Trace out problem.??
Vishnu Narayan Mishra
Software Engineer
|
|
|
|
|
|
Thanks a lot for sharing the nice article. I have just read it. He mentioned about how to change ASP.NET to run under medium trust. but I think the most of ASP.NET hosting doesn't change like that, isn't it? I had some experiences in using DiscountASP.NET last year.. I'm able to access the Access database using Oledb.
WebPermission is restricted. This means your application can only communicate with an address or range of addresses that you define in the <trust> element.
Do you have any idea about this line? I'm not very clear with this.
Thanks again for sharing the interesting link.
|
|
|
|
|
I am afraid my experience with hosting is very limited, The company I work in host their own solutions, so this is never a problem.but AFAIK with Meduim trust you can only connect to SQL Server but I am not sure to be honest.
|
|
|
|
|
|
1. As Bassam Saoud suggested, your hosting might not give the permission to do that.
2. You need to add your website as the trusted site in your IE even your hosting give you the permission...
3. I don't think it's good idea to use Shell32 dll in web application.
|
|
|
|
|
using this code i downloaded one mdb file,down loaded successfully but it is not able to open... one error showing that unrecognized database format.
used codes is given below
string filepath = "../App_Data/Segasys.mdb";
string filename = System.IO.Path.GetFileName(filepath);
Response.Clear();
Response.ContentType = "application/ms-access";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.Flush();
Response.WriteFile(filepath);
please advise on this issue....
thanks
surjith
|
|
|
|
|
Is the file you downloaded the same number of bytes ? If you have debugging turned on, the debug HTML sometimes gets written, try a Response.End at the end of that code.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|