|
Hi Abhijith,
Thanks for your reply...
My code is as follows. Please tell me how to create menu subitem on this...
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" ForeColor="white" BorderStyle="None"
Height="30px" onmenuitemclick="Menu1_MenuItemClick">
<DynamicHoverStyle ForeColor="#000000" BackColor="Black"/>
<Items>
<asp:MenuItem Text="File" Value="File">
<asp:MenuItem Text="Open" Value="Open" ToolTip="Open File"></asp:MenuItem>
<asp:MenuItem Text="Recent Files" Value="Recent"></asp:MenuItem>
<asp:MenuItem Text="Exit" Value="Exit"></asp:MenuItem>
</asp:MenuItem>
Thanks....G.Paulraj
|
|
|
|
|
You need to close <items> tag and <asp:menu> tag First.
Try This :
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" staticdisplaylevels="5" BorderStyle="None"
onmenuitemclick="Menu1_MenuItemClick">
<Items>
<asp:MenuItem Text="File" Value="File">
<asp:MenuItem Text="Open" Value="Open" ToolTip="Open File"></asp:MenuItem>
<asp:MenuItem Text="Recent Files" Value="Recent"></asp:MenuItem>
<asp:MenuItem Text="Exit" Value="Exit"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:menu>
And In Code Behind :
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
Response.Write(e.Item.Text);
}
Here you will find on click of every menu items / subitems , Menu Text getting write on page.
Hope this will help you !
|
|
|
|
|
Ya... Its working fine...
Thanks...G.Paulraj
|
|
|
|
|
Welcome
|
|
|
|
|
Hi,
I have developed a web application which need to be deployed in client location. Can any body tell me how i can package it, so that others cannot view the code. My application is having both asp and asp.net pages.
|
|
|
|
|
|
First thing that you need to it, Publish the code. Right Click on Solution > Publish Web Site. After Publishing the site, you will not find any .cs file in your published folder, all code will be converted in to dll only.
After than , you can create a Web Setup project which will work as Installer.
Please have a look into this,
http://www.beansoftware.com/ASP.NET-Tutorials/Deploy-ASP.NET.aspx[^]
This may help you. Let me know if you need more information.
Thanks !
|
|
|
|
|
public
void BindThumbnails()
{
DataSet ds = new DataSet();
ds = GetBinaryImagesByProfileID.FetchAllImagesInfo(intGetProfileID, "omegaloveConnectionString");
DLThumbnails.DataSource = ds;
DLThumbnails.DataBind();
}
Now when I come to the page on load I call the method BindThumbnails with a variable intGetProfileID
Will refresh the databind.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:omegaloveConnectionString %>"
SelectCommand="sprGetBinaryImages" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="ProfileID" Type="Int32" DefaultValue="0" />
</SelectParameters>
</asp:SqlDataSource>
<asp:DataList ID="DLThumbnails" runat="server" RepeatDirection="Horizontal" CellPadding="3" DataKeyField="img_id"
HorizontalAlign="Center" CssClass="view" RepeatColumns="5" Item-BorderWidth="1"
Item-BorderColor="#c0c0c0" OnItemDataBound="DLThumbnails_ItemDataBound" OnItemCommand="DLThumbnails_ItemCommand"
BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
GridLines="Horizontal" ShowFooter="False" ShowHeader="False"
DataSourceID="SqlDataSource1">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<ItemStyle Width="20%" BackColor="#E7E7FF" ForeColor="#4A3C8C" BorderColor="silver"
BorderStyle="dotted" BorderWidth="3px" HorizontalAlign="Center" VerticalAlign="Bottom" />
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<FooterTemplate>
</FooterTemplate>
</asp:DataList>
How can I fix the above so I do not get the following error:
Both DataSource and DataSourceID are defined on 'DLThumbnails'. Remove one definition.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Both DataSource and DataSourceID are defined on 'DLThumbnails'. Remove one definition.
Source Error:
Line 82: ds = GetBinaryImagesByProfileID.FetchAllImagesInfo(intGetProfileID, "omegaloveConnectionString");
Line 83: DLThumbnails.DataSource = ds;
Line 84: DLThumbnails.DataBind();Line 85: //CountPhotos = Convert.ToInt32(ds.Tables[0].Rows[0]["NumberOfPhotos"].ToString());
|
|
|
|
|
You are getting this error because of DLThumbnails having two different dataSource. And the error message is saying the same thing.
If you check in codebehind,
macupryk wrote: void BindThumbnails()
{
DataSet ds = new DataSet();
ds = GetBinaryImagesByProfileID.FetchAllImagesInfo(intGetProfileID, "omegaloveConnectionString");
DLThumbnails.DataSource = ds;
DLThumbnails.DataBind();
}
You are giving data source of DLThumbnails as ds .
On the other hand, in aspx page, you have created one more SQLDataSource,
macupryk wrote: <asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:omegaloveConnectionString %>"
selectcommand="sprGetBinaryImages" selectcommandtype="StoredProcedure">
<selectparameters>
<asp:parameter name="ProfileID" type="Int32" defaultvalue="0">
and you have also assigned the same SQLDataSource as the DataSource of DLThumbnails . Which causes the confiliction error. You can remove any one them. Just Remove DataSourceID="SqlDataSource1" From Datalist aspx code. It will work
Hope this will help you. Let me know if you need any more help.
Thanks !
|
|
|
|
|
I have a web control defined like
class SomeControl<T> : WebControl
...
How do I use it directly in an aspx page (= .aspx file), with the type specification?
In the code, it is easily
SomeControl<int> ctrl = new SomeControl<int>();
but in the aspx, I am clueless. Any ideas?
|
|
|
|
|
I didn't get your question. Sorry ! Here you are creating the object of web user control, then how does this related with aspx page code. Can you please describe it in more details, so that I can help you.
Thanks!
|
|
|
|
|
Hello,
My application is in Asp.net1.1 hence the third party ABCpdf can be used in this project. Hence i created a webservice in Asp.net2.0. Upon test run, its working okay and creating the PDF document from a url and saving in one of the directory of my orignal application written in ASP.net1.1.
I created the proxy class using Wsdl.exe of vs2005 and added the class in the ASp.net1.1 application.Build is okay. no error. But this class in not refereced in the project. Hence i cannot invoke the method to save the webpage as PDF. How to reference the proxy class. Its object is not being created and the project is not recognizing. The rest of the ASp.net1.1 project is in VB.net but this proxy class in in C#.
What should i do.Every thing is working okay i just need to invoke the webservice from ASP.net1.1 project. Plz help.
Thanks,
Ali
|
|
|
|
|
|
Thanks alot. My issue is solved.
|
|
|
|
|
Any Time ..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I have a very large XMLDocument with 56,000 child records each having 8 child field elements. The application that i have written performs a complicated process on the XML. It can process 10,000 records in 5 minutes and 20,000 in 25 minutes (increases exponentially) but takes maybe 10 hours to process the 56,000 record (which is unacceptable). Whats the best way to de-batch this XML Document into bite size chunks (eg 10,000 and after 5 iteration will process 50,000. which will execute in 25-30 minutes processing time)
Thanks.
|
|
|
|
|
Have you tried any multi-threading? I'd also revisit the algorithm, or work being done; it seems excessive to use that much time. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You can try these 3 ways...
1. as Mark suggested use multithreading
2. load the xml doument in datatable and perform the task, it will be much more faster then processing a file on the disk.
3. if possible try to create a global temp table in sql server (##tablename , so that you don't lose the table on connecting close), and insert the xml document in the table and after that you can fire Select / Update statement on the table and get desired result.
you can use all of the 3 at the same time to get the improved performance...modified on Sunday, February 28, 2010 6:39 PM
|
|
|
|
|
Thanks i'll give that a try
|
|
|
|
|
I hava a simple Web Service create by C#.
And now I need to let the user visit this web service through apache.
How to set it in the apache, it need to modify the C# code?
|
|
|
|
|
|
It is a good answer, thanks very musch
|
|
|
|
|
Hi,
I gave the follow code snippet :
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
<div>
<asp:ComboBox ID="ComboBox1" runat="server">
<asp:ListItem Text="Item1" Selected="True" />
<asp:ListItem Text="Item2" />
<asp:ListItem Text="Item3" />
<asp:ListItem Text="Item4" />
</asp:ComboBox><br /><br />
<asp:Button ID="EnableButton" runat="server" Text="Enable"
onclick="EnableButton_Click" /> 
<asp:Button ID="DisableButton" runat="server" Text="Disable"
onclick="DisableButton_Click" />
With code behind :
<br />
protected void EnableButton_Click(object sender, EventArgs e)<br />
{<br />
ComboBox1.Enabled = true;<br />
}<br />
<br />
protected void DisableButton_Click(object sender, EventArgs e)<br />
{<br />
ComboBox1.Enabled = false;<br />
}<br />
Why do I have to press the "Enable" button twice to enable a disabled ComboBox ?
How can I solve the problem ?
tia
|
|
|
|
|
You don't have an ajax combobox. Just by placing a scriptmanager on the page does not automagically make it ajax.
Enabling and disabling controls can easily be accomplished on the client-side with javascript. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
This is because you are not using an UpdatePanel . add an UpdatePanel on the page and put everything inside except ScirptManager . and it will work. and also use the scriptmanager instead of toolkitscriptmanager.
if you want to do this without AJAX for testing then add Response.Redirect("~\ThisPage.aspx"); after you set the combobox enable true or false, and you dont have to click twice to enable or disable it.
|
|
|
|