|
Hello all,
This may be a repost but I can't find the original message.
I have a server asp:button control in the content place holder of a content page.
I create the event handler in the code behind through the properties editor. When I click on the button the server side event won't get fired.
I tried using a postback and an hidden input to change a value to achieve the same effect to no avail.
The hidden input's value does not get updated.
What am I missing?
Thank you.
Alberto Bar-Noy
Project Manager
http://www.consist.co.il
|
|
|
|
|
Hi,
I am having linkbuttons using buttonfield column. grid gets diplayed and when click the linkbutton to open another page using window.open(Javascript)in rowcommand.every thing works fine.
Issue is:
1. when i first time I click the linkbutton on the grid - opens a page A in new window(window.open).
2. when i second time I click the another linkbutton on the grid - opens a page B in new window(window.open).
3. then I click the back button on the browser(gridpage) - now It automatically opens up the page A , Which I dont expect.
Please let me know how to avoid the window that get opened up when I go back on the browser.
For your Information I Paste the code I use.
Linkbutton column:
<asp:buttonfield commandname="proj_no" datatextfield="proj_no" headertext="Project No."
="" text="Project No.">
<itemstyle cssclass="ca_item_proj">
<headerstyle cssclass="ca_header_border">
Rowcommand:
If e.CommandName = "proj_no" Then
Dim i As Integer = Convert.ToInt32(e.CommandArgument)
Dim proj_no As String
proj_no = CType(ctrl, LinkButton).Text
Session("projectno") = proj_no
Response.Write("javascript:window.open('LinkAspApp.aspx','','scrollbars=yes,menubar=yes,height=600,width=800,resizable=yes,toolbar=yes,location=yes,status=yes');")
endif
Thanks
Mohamed
|
|
|
|
|
Hi,
I am using an ajax update panel with an image button inside, i want to show a message when i click tue button:
Protected Sub button_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles button.Click
Dim msgAlert As String = "alert('My message');"
Microsoft.Web.UI.ScriptManager.RegisterStartupScript(Page, Me.GetType(), "click", msgAlert, True)
End Sub
But when i click the button the message doesn't show, but if put the button outside the update panel the message does show.
i wonder if somebody knows how to show messages when we use an update panel.
Thanks,
Alberto Martinez
|
|
|
|
|
please provide some code or explanation how to store user defined class objects using c#.net. actually i have one class and want to store its objects in my web application. please help me for that. so what to use cache,view state or session object and how?
|
|
|
|
|
To change ObjectDataSource sorting order I use SelectingEventHandler
ObjectDataSourceValitutAsukkaat.Selecting += new ObjectDataSourceSelectingEventHandler(ObjectDataSourceValitutAsukkaat_Selecting);
void ObjectDataSourceValitutAsukkaat_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.Arguments.SortExpression = "SURNAME";
}
But how to change dynamically Objectdatasource sorting collation ?
|
|
|
|
|
|
But how to change collation order in sorting ?
Tableadapter table default locale is "Finnish", but in runtime I want use different collations
|
|
|
|
|
What are you binding your objectdatasource to? If it is a gridview, all you have to do is set the SortExpression to the data field you want to sort by when the column header is clicked.
Ben
|
|
|
|
|
I'm using ObjectDatasource with ReportViewer control and choose
different collation order.
|
|
|
|
|
I am not that familar with the ReportViewer control. I would assume it work similar to other controls, so it should have a sorting event that should get called when the control is requesting a different sort. If it does have a sorting event you could do something similar to what I have documented in my article I posted before.
Ben
|
|
|
|
|
There exists Selecting event as I write
ObjectDataSourceValitutAsukkaat.Selecting += new ObjectDataSourceSelectingEventHandler(ObjectDataSourceValitutAsukkaat_Selecting);
void ObjectDataSourceValitutAsukkaat_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.Arguments.SortExpression = "SURNAME";
}
Problem is, that this ObjectDataSource result is filled to tableadapter datatable, which
default locale is "Estonian" and result is sorted by SURNAME using Estonian collation
I want change this sorting collation dynamically to Finnish, swdish and so on.
|
|
|
|
|
Your problem is still the same. You have a Reportview control. You do something with that control to affect the sort. So an event off that control is where you will have to work with the sorting. By doing it in the objectdatasource_selecting method you will overwrite anything else you try to do. It will always force the sort to be the same.
Ben
|
|
|
|
|
Yes, I m doing before selecting, setting SortExpression
void ObjectDataSourceValitutAsukkaat_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.Arguments.SortExpression = "SURNAME";
}
and it sorts result by Estonian, now I want change it to Finnsih or Swedish
How to do that ?
Kuido
|
|
|
|
|
I am not sure why Setting the SortExpression to "SURNAME" in the selecting event of the objectdatasource would sort the results by estonian. I am pretty sure that it will always sort that way since it is being set in the selecting event of the object datasource. Normally if you want to dynamically change the SortExpression you do it on the Sorting event of the control that the objectdatasource is bound to. In this case it is your reportViewer. So like I suggested before, on the reportViewer there is a sort method, you need to be using that method to affect the sort and then it will get passed through to your objectdatasource.
Ben
|
|
|
|
|
Problem is in the sorting collation. ObjectDatasource uses strongly-typed dataset which collation is Estonian. It selects data from database and puts data to that dataset table using that table default collation(Estonian)
I wanna change collation order already in ObjectDatasource not in ReportViewer control.
|
|
|
|
|
That sounds more like a culture setting thing. So if you set the Thread.CurrentCulture it should affect String sorting.
Ben
|
|
|
|
|
Works in this way
dsReportsTableAdapters.RAPORT_VALITUT_ASUKKAAT_KUIDO_STableAdapter ta = new dsReportsTableAdapters.RAPORT_VALITUT_ASUKKAAT_KUIDO_STableAdapter();
dsReports.RAPORT_VALITUT_ASUKKAAT_KUIDO_SDataTable tb = new dsReports.RAPORT_VALITUT_ASUKKAAT_KUIDO_SDataTable();
// set locale for table
tb.Locale = System.Globalization.CultureInfo.CurrentUICulture;
ta.Fill(tb, ....);
this.ReportViewerAsendus.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("dsReports_RAPORT_VALITUT_ASUKKAAT_KUIDO_S", tb.Select("","SURNAME")));
|
|
|
|
|
Glad you figured it out, thanks for posting the solution.
Ben
|
|
|
|
|
I have a DDL with a load of values in it and a button. Select the value from the DDL hit the button and that option gets added to a list.
I want to create this list on screen in a temporary format and allow the user to remove options they may have already added.
What would you say the best control would be to do this. I was planning on the Bulleted List one but it doesn’t seem to have good enough features to add a removed button to each item!
??
Thanks
|
|
|
|
|
You could try a checkboxlist. It has worked pretty well for me in the past.
Ben
|
|
|
|
|
hi All
I have a Grid that has 12 Columns, and i want to lock all the Columns from being Edited at runtime, and the open one Column for Edit. how can i achieve that in vb.net.
Thanks
Vuyiswa Maseko
|
|
|
|
|
You can make them readOnly or display as labels rather.
|
|
|
|
|
hi
i understand that, but i need the steps to do that, if can send a link to an article or if you can show me , i will be very greatfull thank you
Vuyiswa Maseko
|
|
|
|
|
we are trying o implement this in <b>asp.net 2.0 C#</b> and when we try to run the project it is giving this error can anybody help please urgent we took this project named as blogengine.net from http://www.codeplex.com/blogengine
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Coding:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="BlogEngine">
<section name="blogProvider" requirePermission="false" type="BlogEngine.Core.Providers.BlogProviderSection, BlogEngine.Core" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/>
</sectionGroup>
</configSections>
<BlogEngine>
<blogProvider defaultProvider="XmlBlogProvider">
<providers>
<add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider"/>
<add name="MSSQLBlogProvider" type="BlogEngine.Core.Providers.MSSQLBlogProvider"/>
</providers>
</blogProvider>
</BlogEngine>
<connectionStrings configSource="sql.config" />
<system.web>
<compilation debug="true" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
<httpRuntime enableVersionHeader="false" sendCacheControlHeader="true" />
<trust level="High" />
<machineKey
validationKey="D9F7287EFDE8DF4CAFF79011D5308643D8F62AE10CDF30DAB640B7399BF6C57B0269D60A23FBCCC736FC2487ED695512BA95044DE4C58DC02C2BA0C4A266454C"
decryptionKey="BDAAF7E00B69BA47B37EEAC328929A06A6647D4C89FED3A7D5C52B12B23680F4"
validation="SHA1" decryption="AES"
/>
<authentication mode="Forms">
<forms timeout="129600" name=".AUXBLOGENGINE" protection="All" slidingExpiration="true" loginUrl="~/login.aspx" />
</authentication>
<pages enableSessionState="false" enableViewStateMac="true" enableEventValidation="true">
<controls>
<add namespace="Controls" tagPrefix="blog"/>
</controls>
</pages>
<customErrors mode="RemoteOnly">
<error statusCode="404" redirect="~/error404.aspx" />
</customErrors>
<membership defaultProvider="XmlMembershipProvider">
<providers>
<clear />
<add name="XmlMembershipProvider" type="BlogEngine.Core.Providers.XmlMembershipProvider" description="XML membership provider" xmlFileName="~/App_Data/users.xml"/>
</providers>
</membership>
<siteMap defaultProvider="PageSiteMap" enabled="true">
<providers>
<add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.PageSiteMap"/>
</providers>
</siteMap>
<httpModules>
<add name="UrlRewrite" type="BlogEngine.Core.Web.HttpModules.UrlRewrite"/>
<add name="CompressionModule" type="BlogEngine.Core.Web.HttpModules.CompressionModule"/>
<add name="ReferrerModule" type="BlogEngine.Core.Web.HttpModules.ReferrerModule"/>
<add name="WwwSubdomainModule" type="BlogEngine.Core.Web.HttpModules.WwwSubdomainModule"/>
</httpModules>
<httpHandlers>
<add verb="*" path="microsummary.axd" type="BlogEngine.Core.Web.HttpHandlers.MicroSummary" validate="false"/>
<add verb="*" path="file.axd" type="BlogEngine.Core.Web.HttpHandlers.FileHandler" validate="false"/>
<add verb="*" path="image.axd" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler" validate="false"/>
<add verb="*" path="syndication.axd" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler" validate="false"/>
<add verb="*" path="commentfeed.axd" type="BlogEngine.Core.Web.HttpHandlers.CommentFeedHandler" validate="false"/>
<add verb="*" path="sitemap.axd" type="BlogEngine.Core.Web.HttpHandlers.Sitemap" validate="false"/>
<add verb="*" path="trackback.axd" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler" validate="false"/>
<add verb="*" path="pingback.axd" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler" validate="false"/>
<add verb="*" path="opensearch.axd" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler" validate="false"/>
<add verb="*" path="metaweblog.axd" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler" validate="false"/>
<add verb="*" path="rsd.axd" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler" validate="false"/>
<add verb="*" path="css.axd" type="BlogEngine.Core.Web.HttpHandlers.CssHandler" validate="false"/>
<add verb="*" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler" validate="false"/>
<add verb="*" path="opml.axd" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler" validate="false"/>
</httpHandlers>
</system.web>
</configuration>
regards
Harry
|
|
|
|
|
In IIS ensure that the virtual folder is set as an application. If you are not sure how to do this post back and I will offer assistance.
|
|
|
|