|
If your server is properly secured you shouldn't have this problem. Make sure that only the relevant personel can log in to the server, or if it is shared, restrict write access on the web.config file to specific users using standard windows security.
|
|
|
|
|
In my application I want to call a java script in a button click at the code behind.And the button is inside an update panel.But the java script is not working.If i place the button out side the update panel then it is working.My question is how to call the java script by placing the button inside the update panel?
|
|
|
|
|
How are you registering your javascript call? You might want to try ScriptManager.RegisterStartupScript , as this will be called following a callback.
|
|
|
|
|
I have already used it but still not working.
|
|
|
|
|
Have you added your button control inside the <triggers> tag of the Update panel...
and one more thing you also need to know whether it is a post back trigger or asynchronous trigger...
If you are not aware of this, Just try this the following piece of code
<Triggers>
<asp:postbacktrigger controlid="Your Button Name">
<asp:asyncpostbacktrigger controlid="Your Button Name" eventname="Click">
</Triggers >
Regards,
Vengat P
|
|
|
|
|
<asp:TemplateField HeaderText="Date" HeaderStyle-HorizontalAlign="Left" SortExpression="RecievingDate">
<EditItemTemplate>
<asp:TextBox ID="txtDate" Width="100px" runat="server" Text='<%# Bind("Coupon_Info.RecievingDate") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtDate1" runat="server" Width="100px"></asp:TextBox>
</FooterTemplate>
<ItemTemplate >
<asp:Label ID ="date" runat ="server" Text ='<% Bind("Coupon_Info.RecievingDate") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
this code doesnot work. it show no result in my gridview. i want to update my gridview which contains different attributes of two tables. what should b my binding property
|
|
|
|
|
Did you used GridView.Bind() to bind the data source with your grid control.
|
|
|
|
|
yeah i used Gridviewbind()
|
|
|
|
|
hi,
<asp:templatefield headertext="Date" headerstyle-horizontalalign="Left" sortexpression="RecievingDate>
<EditItemTemplate>
<asp:TextBox ID=" txtdate"="" width="100px" runat="server" text="<%# Eval("Coupon_Info.RecievingDate") %>">
<itemtemplate>
<asp:label id="date" runat="server" text="<% Eval("Coupon_Info.RecievingDate") %>">
<footertemplate>
<asp:label id="dates" runat="server">
and Code Behind,
gridview.RowUpdating event
do insert/update/select operation
then finally binding the Gridview
it will work........
I hope it will work....
Regards,
kannak.........
kannak
|
|
|
|
|
thnx 4 help but it cann't show any data in gridview.it shows gridview without data and it also shows edit link.
|
|
|
|
|
Hi,
Can u plz copy ur code....i ll try to resolve...
regards,
kannak........
kannak
|
|
|
|
|
Hello everyone,
I have a gridview,in which each row populates a question with its answers(as radio buttons). I have to execute some code on radio button's OnCheckedChanged event.Somehow,on its OnCheckedChanged event,page is postbacked but it is not going to OnCheckedChanged() method.Can anyone give any suggestions for how can I achieve this?
The code looks somewhat like this :
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="GridView1" OnRowDataBound="GridView1_OnRowDataBound" AutoGenerateColumns="false"
runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView2" AutoGenerateColumns="false" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="true" OnCheckedChanged="RadioButton2_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
|
|
|
|
|
Clean Solution and then Rebuild.
|
|
|
|
|
Thanx for your reply,but I have already tried doing this. In fact,I created a separate project just to check whether it works or not,but it still failed.
The same method I called on a button's OnClick & it worked but it didn't work for RadioButton's OnCheckedChanged().
|
|
|
|
|
Since you have defined the control inside grid u have to create the checked event, ex-
<asp:GridView ID="grdSearch" runat="server" Width="100%">
<Columns>
<asp:TemplateField HeaderText="FirstName">
<ItemTemplate>
<asp:LinkButton ID="lbtnFName" runat="server" Text='<%# eval("fname") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Code behind-
Protected Sub grdSearch_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdSearch.RowCreated
Dim LinkButton1 As LinkButton
Select Case e.Row.RowType
Case DataControlRowType.DataRow
LinkButton1 = CType(e.Row.FindControl("lbtnFName"), LinkButton)
AddHandler LinkButton1.Click, AddressOf lnkApptBtn_Click
End Select
End Sub
'Handler function
Protected Sub lnkApptBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim lngPcpid As Long
Dim lnkbtn As LinkButton = CType(sender, LinkButton)
Dim objItem As GridViewRow = CType(lnkbtn.Parent.Parent, GridViewRow)
Dim intSelectedRow As Integer = CInt(objItem.RowIndex.ToString())
lngPcpid = Trim$(grdSearch.Rows(intSelectedRow).Cells(4).Text)
End Sub
U just have to change the link button event to radio button event
All the best
|
|
|
|
|
Im looking for documents(programming languages) that would guide me in creating an interface that reads network data. So i guess i should start by creating the interface or finding out how to read network data and input database.
|
|
|
|
|
Hello all.
I'm working with a Web Application on IIS6 and ASP.NET 2.0, on a Windows 2003 server. This app has a class that implements the IHttpModule interface. So far, it overrides the HttpApplication.Context.Filter property to perform some filters on the data being streamed. The class looks something like the following:
public class PageCleanerStream
{
}
public class PageCleanerHttpModule : IHttpModule
{
PageCleanerHttpModule() { }
public void Dispose() { }
public void Init(HttpApplication context)
{
context.PostRequestHandlerExecute += new EventHandler(
delegate(object sender, EventArgs args)
{
if (sender is HttpApplication)
{
using (HttpApplication app = sender as HttpApplication)
{
if (app.Context.CurrentHandler is Page)
app.Response.Filter = new PageCleanerStream(app.Response.Filter);
}
}
}
);
}
}
Of course, I have my web.config properly configured and so far everything works as expected: the filter performed by PageCleanerStream does its work well.
Now, I have a new requirement stating that such filter should not be performed on a particular page (i.e. when "somepage.aspx" is requested the filter should not apply. So, I thought it was only a matter of getting the URL of the page being requested and see if it matches "somepage.aspx".
However, I haven't found a way of getting such URL. So far, I've tried three approaches.
1. Cast app.Context.CurrentHandler to a Page , and if not null, then check the Url property. Something like:
Page page = app.Context.CurrentHandler as Page;
if (page.Request.Url.GetLeftPart(UriPartial.Path).IndexOf("somepage.aspx") < 0)
app.Response.Filter = new PageCleanerStream(app.Response.Filter);
This fails because at the time the event is invoked the page.Request object is unavailable.
2. Get the URI property from HTTP headers, as:
if ((app.Response.Headers["URI"]).IndexOf("somepage.aspx") < 0)
app.Response.Filter = new PageCleanerStream(app.Response.Filter);
This approach fails too since it throws a PlatformNotSupportedException , saying that such property requires IIS 7 and .NET Framework 3.0, and at the time, changing the environment is not an option.
3. Finally, I tried calling the HttpResponse.RedirectLocation , yet it returns a null .
So now I'm out of ideas, other than ask for help and keep googling to see if I can find something useful. So... under this scenario, does someone know how could I determine the page's URL being
requested? I'm opened to new approaches as well.
Any clue will be really appreciated.
Thanks in advance.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
hello,
I have the same problem.
Did you solve this issue?
thank oyu
|
|
|
|
|
Hi there. Unfortunately, nope, I couldn't solve it. I had to re-orginze my entire code so that I would not depend on such feature.
Cheers and good luck.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
thank you
E.
|
|
|
|
|
Hi,
I am using a Button column command to fire an event. I assumed that when the button is clicked, the SelectedIndexChanged event would fire and then run some code, since there is no actual 'click' event....but it does not. I thought that this might be due to an AutoPostback setting, but I cannot find one for the GridView control. If there is one, or if there is another way to do this, I would appreciate if someone could explain it to me, as well as what causes the SelectedIndexChanged event to fire.
Thank You, Pat
|
|
|
|
|
Dear all,
Im using a gridview to show some data from my db table(sql server 2008 express).
I want to show two columns of my table : 'id' and 'eventText' . Bud because the 'eventText' column can have a lot of text, i want to show only some of it in the gridview with a hyperlink 'read more'. Clicking on 'read more', brings the user to other page and shows the entire text of the selected row.
Im very new with this and hope you can help me.
Thanks.
|
|
|
|
|
You need to write a custom binding that formats the text to show it the way you want it to, with a link to the other page.
Is this homework ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for rewriting my question as answer...yes it's homework.
|
|
|
|
|
Priya Prk wrote: Thanks for rewriting my question as answer...yes it's homework.
That sounds bad. Really bad!
|
|
|
|