.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem with Paging Back

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net


I have a .Net application that sits within an iframe of another application, and the .Net application is executed via a query string. What I would like to know is whether I can access a Session variable using JavaScript that I will set in my .Net application from the outside application? The other problem is that the .Net application sits in one domain and the other application sits in another domain (i.e. they are on different servers)

View Complete Post

More Related Resource Links

ASP.NET Grid View Paging and GridDataRowBound Problem -



I have a problem displaying data in a Grid View control when I set a row to visible = false when a certain condition is true.

For example, if a DataRowData value has a condition set to true (custom in table) I set the visible property to false, so the data row will not be visible at run time.

The problem is that I'm using paging (10 rows per page) and if 8 of those rows fall into the true condition that won't show the row, that grid view page will only show two rows of data in page 1. The worst scenario is that if I go to page 2 of the grid view and all the rows (10) fall into the true condition, that grid view page will not show any data at all.

How can I show 10 rows of data at all times in a gridview? In other words, I would like to just show the visible rows at all times.

Any help will be greatly appreciated.


checkboxlist full post back problem is association with PopupControlExtender


I have used a checkboxlist in association with PopupControlExtender. All the items are inside the update panel. I used the server side SelectedIndex changed event of checkbox list for another purpose.  But it cause full post back while checking the check box item. The update panel doent make any sense here.

        <asp:ScriptManager ID="Scriptmanager1" runat="server">
        <asp:UpdatePanel ID="UpdatePanel3" runat="server">

Problem when I back to page


Hi Friends

I have page A.aspx where I show some result in listview. When I click On Some data on listview I go to page B.aspx.

Now the problem is when I click on back in page B.aspx it comes to A.aspx with out previous listview result. Ack requirement is when I come to page A.aspx result of listview has to be there. How do i do that?

Could u please help me out?



Routing, Paging and Area problem. Please, anyone?

Hello,On a pager I use on my MVC site I create the page links as follows: private String GetPageLink(Int32 number, String text) { RouteValueDictionary link = new RouteValueDictionary(_values); link.Add("page", number); VirtualPathData path = RouteTable.Routes.GetVirtualPath(_context.RequestContext, link); return path == null ? null : String.Format("<a href=\"{0}\">{1}</a>", path.VirtualPath, text); } // GetPageLink On a MVC 2 web site I have an area named CMS.For example, on "cms/article/list" the pager works fine.However, on my root views, for example in "article/index" the page 1 link become:  http://localhost:7422/cms/article?page=9It should be just:  http://localhost:7422/article?page=9o On my Global.Asax I have the following:  routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new String[] { "PrjMvc.Presentation.Controllers" }); routes.MapRoute("CMS_Area", "{area}/{controller}/{action}/{id}", new { area = "CMS", controller = "Home", action = "Index", id = UrlParameter.Optional });Any idea how to fix this?I have been going around with this and I can't find a

logout problem(after logout when clicking on back button after logout still opens the previous page

I am using ASP.NET, the web page is abandoning and clear session when a user click logout link but they click the back button and it is still showing the previous page. How can it prevent the previous page after logout?on Logout.aspx load im using this code//=================//        Session.Clear();        Response.Buffer = true;        Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);        Response.Expires = -1500;        Response.CacheControl = "no-cache";        //----- Second Technique : To Stop Caching of Secure Pages.        Response.Cache.SetCacheability(HttpCacheability.NoCache);        FormsAuthentication.SignOut();        if (Session["UserName"] == null)        {            Response.Redirect("login.aspx");        }       Session.Clear();         Response.Buffer = true;         Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);         Response.Expires = -1500;         Response.CacheControl = "no-cac

Problem with gridview paging

HI I have problem in Gridview paging, i am using pagersettings.firstpageimageurl to set the image, if i do like this the page will call twice all its event, and if i remove this image, the page will work correctly. if anybuddy know why its so, please replay <   pagersettings mode="NextPreviousFirstLast"   firstpageimageurl="Images/nav_first.gif"   firstpagetext="First Page"   lastpageimageurl="Images/nav_last.gif"   lastpagetext="Last Page"   nextpageimageurl="Images/nav_next.gif"   nextpagetext="Next Page"   previouspageimageurl="Images/nav_previous.gif"   previouspagetext="Previous Page"   position="Bottom"/>

Gridview paging problem

i am facing a problem of gridview paging. In Datalist, i am showing thumbnail images . After click thumnail, images will come up in ajax modalpopup in gridview. If i click on first thumbnail and images will come up in gridview if i close the popup while seeing second image in gridview and click on other thumbnail then images will come up but 2 image is showing instead of 1. because i ahve closed my previous popup while seeing 2 image. if i close the modal popup while seeing 3rd images, next time aftr binding it is showing 3rd images instead of start with 1st.   Datalist showing thumbnail                                                                                                                                                                           <asp:DataList ID="DatalistProducts" RepeatDirection="Horizontal" RepeatColumns="3"   runat="server" OnItemCommand="DatalistProducts_I

Problem with datalist paging


I having a little problem to get the paging for my datalits to work. I have used this article: http://aspalliance.com/157 which i found do the things i wanted. I have implemented the code but no records show at all.. No errors.. Can anybody see what i have done wrong? Thank you!

Here is my aspx code:

<h2 align="center"><font face="verdana">Paging in DataList</font></h2>
<a name="this"></a>

<asp:DataList ID="dList" Runat="server" Width="100%"

<table width="100%" style="font: 10pt verdana" cellpadding=0 cellspacing=0>
<tr style="background-color:FF0000">
<th align=left><font color="#FFFFFF">Store ID</font></th>
<th align=left><font color="#FFFFFF">Order Number</font></th>

<tr style="background-color:#f5f5dc">
<td><%#DataBinder.Eval(Container.DataItem, "pName")%></td>

problem when passing data from view back to controller?


I have following situation - I am pasing user info object from Controller to View. It contains GUID UserID,  which i dont want to be seen on page.

So I  removed every   Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc... from generated View source.

And because of this when Html.BeginForm() returns that object back to Controller  all values is there but UserID is lost??

If I leave Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc.. in View everything is fine.

But I dont want to show UserID?

Where is the problem here?

                <%= Html.LabelFor(model => model.C__User_Id) %>

Problem with Sharepoint 2010 - Claims Auth - Windows Auth and FBA. consistent redirects back to "cho


We have sharepoint 2010 foundation site that we can successfully login with via IE, Firefox, Chrome both on the domain and externally with Claims Authentication with only Windows Auth type selected (NTLM).

Once we add FBA and use the default signin page, we can still login (we select Windows Auth from the dropdown) BUT it only works on the domain. When we try to access externally, the only browser that works is FireFox. Both Chrome and IE just constantly redirect back to the Choose Authentication dropdown screen.

We have tried for the last 2 days to sort this out. Has anyone else experience this? It looks like the default sign in page somehow doesn't set the cookie for IE and Chrome and just bounces us back to the sign in page...

Thanks for any info...

To clarify, we are not even using the FBA yet. We are trying to login only with the windows auth and domain accounts...

ModalPopupExtender problem with browser back button


ModalPopUpExtender shows popup when user clicks browser back button.

I saw this thread but I could find the solution for this problem.


mesajrapor1 is my user control which contains the modalpopupextender

Here is my code:


protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        HyperLink hyp = (HyperLink)e.Item.FindControl("hypGonderenAD");
        Label lblicer = (Label)e.Item.FindControl("lblIcerikMesaj");
        Label midlbl = (Label)e.Item.FindControl("lblIdMesaj");
        Label sidlbl = (Label)e.Item.FindControl("Label3");

        if (e.CommandName == "SikayetEt")
            mesajrapor1.RaporGonder(hyp.Text.ToString(), lblicer.Text.ToString(), Convert.ToInt32(midlbl.Text), Convert.ToInt32(sidlbl.Text));

Problem with xmlns when I convert object to XML and XML to object back


Hi, I am facing a strange problem.

I have a class object which I am accessing through webservice call.

Now actually that class has a property with type of Array inside that class and that array is the array of same class object. Means in reality, I have detailed tree structure as per how data gets fill up in that class object.

This is how my XML is and my actual code.

string xml_For_Obj = "";

                xml_For_Obj = "<xml version=\"1.0\" encoding=\"utf-16\">  ";
                xml_For_Obj += "    <ComponentObject xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">";
                xml_For_Obj += "        <BundledComponents xmlns=\"http://MySite.com/ISI/OtherWebService/Components\">";
                xml_For_Obj += "            <ComponentObject>";
                xml_For_Obj += "                <SKU>Test Sku Name</SKU> ";
                xml_For_Obj += "                <SubGroup>Test SubGroup</SubGroup> ";
                xml_For_Obj += "                <Quantity>70</Quantity> ";
                xml_For_Obj += "                    <BundledComponents >";

hi problem with grid paging when grid is placed in ajax model popup extender


hi i had one ajax tab containeer.in that i placed a grid on click of the grid i am showing another grid which has pagination in a popup. the popup grid has the pagination(custom) which iam showing prev and next button in middle drop downlist the code is as fllows


<asp:ImageButton ID="imgbtnOPrev" runat="server" CommandArgument="prev" CommandName="Page"

 ImageUrl="~/Images/prev.gif" OnCommand="imgbtnOPre

Back button and update panel problem



I have a search page that uses an AJAX update panel to deliver results to the user. They can then navigate to a product page for more info. So far so good...

My problem occurs when they are on a product page and use the back button. They are redirected to the search page, but its a blank search page and not the one they left when they clicked for product details. I realise this is because the browser only made a history 'marker' (I dont know the technical term) when they first came to the search page, so this is what it returns them to.

Does anyone know how I can make the back button redirect the user to the search page as it was when they left it? I have tried making the page expire immediately and storing the search terms in session state so I can rebuild the page when they click 'back'. This works in IE, but not in Firefox as it seems to just load out the old page from the cache regardless of the expiration policy I set. As if that werent bad enough, this also causes 'corrupted state information' error when they try to search again.

Any suggestions? Any help would be very much appreciated.

Thank you

(PS -  I have seen various solutions to the back button/ajax problem, but none of them seem to address my problem. Or have I missed something?)


Custom paging sorting stored procedure problem



I want to make my gridview enable for custom paging and sorting. I started to follow a tutorial and write the Stored procedure.

But my stored procedure seems not to be working. here it is:

ALTER PROCEDURE [dbo].[USP_getStudentsEmail]
    @sortExpression nvarchar(100),
    @startRowIndex int,
    @maximumRows int,
    @receiver nvarchar(38)

IF LEN(@sortExpression) = 0
    SET @sortExpression = 'SendDate'

DECLARE @sql nvarchar(4000)
SET @sql = 'Select *
	Select m.Body,m.Subject,m.SendDate,m.SenderProfile,m.Receiver AS Receiver,m.ID,s.FirstName,ROW_NUMBER() OVER (ORDER BY '+ @sortExpression + ') AS RowRank 
	from Message m INNER JOIN StudentProfile s ON m.Sender=s.UserId
) AS OrderedEmails
            WHERE     m.Receiver= '+ CONVERT(nvarchar(38), @receiver) + 'AND RowRank > ' + CONVERT(nvarchar(10), @startRowIndex) +
                ' AND RowRank <= (' + CONVERT(nvarchar(10), @startRowIndex) + ' + '
                + CONVERT(nvarchar(10), @maximumRows) +')'

EXEC sp_executesql @sql

I tried to run this by the following line

exec USP_getStudentsEmail 'SendDate',1,1,'5ed19f91-eeb7-4c6a-b564-98c8dd83e18c'

but it says  

Incorrect syntax near 'd19f91'-

can anybody help

Problem in AJAX enabled pages when submitting or posting back


Hi people,

Imagine a simple page containing these controls:

<asp:ScriptManager ID="ScriptManager1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <div id="testDIV">
            <div style="background-color:#DDDDDD">
                <br />
                <asp:Label runat="server" Text="First" ID="Label1"></asp:Label>
                <br />
                <br />
                <asp:Button ID="Button1" runat="server" Text

Dataview paging problem - 2nd page of items being repeated for subsequent pages.


I have a dataview displaying items from a sharepoint list. There are over 2000 items in the list.

When I add paging to the dataview, asking it to display in sets of 20, it looks like it has worked as it has the paging links 1-20, 21-40 etc but on pages 41-60 upwards it just repeats the set of records shown on page 21-40.

This is happening on various pages/dataviews. I have re-added the dataview from scratch but this hasn't made any difference.

Any ideas why this is happening?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend