|
But I like the designer. Besides, this is a TabStrip that I intend to share. There must be something I'm missing that the CollectionEditor does to make the designer aware of the controls it added that I could implement in the control, but I have no idea what.
|
|
|
|
|
|
Thanks, I added the [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] attribute and that fixed the changes issues (It was there before but I removed it thinking it rendundant to the PersistanceMode , oops). I ended up making a custom UITypeEditor to list the child tabs for the SelectedTab property. That brought to my attention a flaw to the logic of setting that property in the designer since it doesn't know how to persist a control value by it's ID. So I ended up setting the [Browsable(false)] attribute on the SelectedTab property and implementing a SelectedTabID property and using the custom UITypeEditor for that property. It is a bit of a workaroung but all is well now.
I know I've seen a TypeConverter or something out there that can be used to list control ids of a certain type, but can't recall how, nor do I think it would work since the designer is still unaware of the child controls unless added with the CollectionEditor.
Thanks for pointing me to your article, looks like a cool control. I'll have to look closer even though I have already implemented a solution.
|
|
|
|
|
Good. Let me know if you find any flaws in the code.
|
|
|
|
|
|
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FileControl.ascx.cs" Inherits="Administration_Controls_FileControl" %>
<div style="width: 100%; height: 50px;">
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="test" runat="server" OnClick="test_click" />
</div>
protected void test_click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
}
}
I have this code, but i keep getting HasFile = false ..
Anyone sees what im doing wrong.. I really dont see it.
Thanks. Wouter
|
|
|
|
|
Are you using this fileupload control inside UpdatePanel.
It will not work inside an UpdatePanel, you need to forcefully postback using
<Triggers>
<asp:PostBackTrigger ControlID="test" >
</Triggers>
|
|
|
|
|
Ok thanks , i posted my usercontrolid in the trigger, now it works Thanks!
|
|
|
|
|
Oh, the button is within a Panel. Use this Solution then :
ScriptManager scr = ScriptManager.GetCurrent(this.Page);
if (scr != null)
{
scr.RegisterPostBackControl(this.mycontrol.FindControl("test"));
}
Place this script inside the Page_Load section.
Now click on the Button test and see if the Onclick event inside the Usercontrol gets fired with file in the FileUpload control.
|
|
|
|
|
|
Most welcome.
Dont forget to click "Good Answer" , if it really helped you.
|
|
|
|
|
in webform.aspx has
<% String vdUser = Request.ServerVariables["AUTH_USER"]; %>
...
<asp:sqldatasource id="dg_vendorTrk" runat="server"
="" connectionstring="<%$ ConnectionStrings:conn_vendor_server %>"
...
updatecommand="UPDATE table1 SET vdLogAs=@vdUser WHERE (vdId=@vdId)">
<updateparameters>
<asp:querystringparameter name="vdUser" defaultvalue="<%= Request.ServerVariables[" auth_user"]="" %="">" />
Please HELP, how can i pass a vdUser to either UpdateCommand or UpdateParameters
|
|
|
|
|
Create an
<asp:hiddenfield id="hdnUser" text="<%= this.vdUser %>">
The variable @vdUser, even if you are sending using parameter, the actual value should be specified in the hiddencontrol.
|
|
|
|
|
Thanks Sur
I got the issue solved. Here is how i did:
in PageLoad()
{
System.Web.UI.WebControls.Parameter pm = new System.Web.UI.WebControls.Parameter();
pm.Type = TypeCode.String;
pm.Name = "name";
pm.DefaultValue = HttpContext.Current.User.Identity.Name.ToString();
GridView1.UpdateParameters.Add(pm);
}
|
|
|
|
|
This is great.
Cheers.
|
|
|
|
|
I am new to asp.net i designed a website. when i was upload the site it shows there no index.html page.
i changed the my main page as index.aspx after that also it not works please help to solve this problem
When i run on my system it will run on the local host, When i was upload the file in server i got this problem
please tell me the step by step procedure to upload the file in server and can you please tell i want add any code to run the page from server
modified on Wednesday, September 30, 2009 11:42 AM
|
|
|
|
|
kn.nageshwaran wrote: when i was upload the site it shows there no index.html page.
Where you have uploaded the site ? when you are geting the error ?
|
|
|
|
|
i did not have any domain name and host space to upload, so i asked to My friend upload my site in some server. what he have. before that i asked him did your server support the asp.net page he asked yes. After uploading he said after i upload the site i just type the url in address bar it shows there is no index.htm page
|
|
|
|
|
The default file is configured by the server. The default for IIS/.Net is normally default.aspx. If you want to use index.aspx, you have to add it to the Default Document list in IIS.
|
|
|
|
|
Welcome to Code Project and please read the forum guidelines.
--Your messages should be more specific. "Need help" is likely to get you ignored.
--Be specific with your problem. Are you getting an error message? If so, what does it say? Post your code also.
|
|
|
|
|
hi..
I need your ftp details. once i check in server, then only i tell
|
|
|
|
|
Hello everyone -
I don't know if this is the right place to ask the question, but here is the thing. I want IIS to treat the .html pages as .aspx pages, so I can reduce the size of the pages. How I can do that, any advices?
Thanks for your help, Laziale
|
|
|
|
|
laziale wrote: I want IIS to treat the .html pages as .aspx pages, so I can reduce the size of the pages.
I am not able to understand what you are looking for . Can you please be more clear ?
Thanks !
|
|
|
|
|
How can you reduce page size in that way? Better is to use gzip compression. If you want to display html pages as aspx pages in browser, use url rewriting.
|
|
|
|
|
I never tried it with HTMLs but Check by following the process below :
Go to IIS console, Right click on Website , - > Go to properties.
Move to Tab Page : Home Directory
Click on Configuration .
In the Mappings Tab click on "Add".
In Executable Choose "aspnet_isapi.dll" . (You will find this in DefaultDrive:\windows\Microsoft\Framework\2.0 )
In the Extension type "html"
Now click OK.
In your webconfig of your website, create an entry for HTTPHandler which handles HTML extension.
You can use this article to remove extra whitespaces and apply GZip Compression to your html.
http://www.codeproject.com/Articles/38067/Compress-Response-and-HTML-WhiteSpace-Remover.aspx[^]
Just write the response back to the stream.
If HTML extension doesnt work for you, try using any other extensions for your html files, preferably axd.
Hope this solution help you.
|
|
|
|