.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

How to determine the Last line/rownumber/record on the current page

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :Sql Server

Hi ,

Need some quick help . Thanks in advance. I am designing a report (sql server reporting services 2005) wherein i have to change the Border style based if it is the Last line/rownumber/record on the current page . I am not sure how to programmatically determine the last line. Any help is highly appreciated.


View Complete Post

More Related Resource Links

Knowing the event occured in user control in current page




      My web application has user control which uses third party controls called Devexpress controls. The user control is a menu  and is part of the Master page. It is placed there because this needs to be available in all the pages. My user controls raises a even on item clicked. Now, My question is that Is there any way to know that the event has occurred in page_load of the current page in which I am in?

How to get current page file name?


I am trying to get the current page file name that i access to.
Lets say i am at test.aspx page, i want it to return me "test" file name.
I tried to use this.Page.toString(), it returned me "ASP.test_aspx" which is like half correct....
but i would like to get only "test".

2nd question, this.Page.toString() will always return me in a format of ASP.[filename]_[fileextention]?
If that's the case, maybe i can use splilt function to get the file name i want if there aren't any better solution than that.



dynamically add record in page


I am creating page dynamically using this. I want to read the file, which is dynamically created and show content on page from database like 40 record in each page.

String root = Server.MapPath("~");
        String pgTemplate = root + "\\myPageTemplate.tmp";
        StringBuilder line = new StringBuilder();        
        using (StreamReader rwOpenTemplate = new StreamReader(pgTemplate))
            while (!rwOpenTemplate.EndOfStream)

        int ID = 0;
        string SaveFilePath = "";
        string SaveFileName = "";
        Random ran = new Ran

How to determine if current SQL User is admin or owner?

I wish to determine, from my C# application, if the current user has admin or owner rights to the database they are connected to. I beleive I have all the information required: Servername Database name Windows/Database auth username (If database auth) password (if database auth) I'm trying to find a way that using the smo objects (smo.user), but as of yet I cant quite work it out: - How to get the appropriate user - How to determine if that user is an admin/owner. Any tips would be appreciated. If I have posted to the wrong forum, let me know - I couldnt find one that was obviously more appropriate. Thanks.

I need help with the syntax for passing a record field value from SSRS to an asp page

I have tried several variations without success.  Here is where I am now.  The goal is from inside Report Manager report, link to an asp page with a filed value. This is from the expression line of the Jump to URL entry. Also I am trying to open a new page http://www.whereever.com/CSSurvey01.asp?RecordID=" & Fields!respid.Value            

CSS - formatting block list items for the current page

I have a sidebar containing an un-ordered list (menu). Each list item is contained in a light grey block when the user hovers over it with the mouse. However I would also like the block to stay grey for the current page that the user is on. HTML <div id="sidebar"> <ul> <li><a href="../001.aspx">001</a></li> <li><a href="../002.aspx">002</a></li> <li><a href="../003.aspx">003</a></li> <li><a href="../004.aspx">004</a></li> <li><a href="../005.aspx">005</a></li> </ul> </div> <!-- end #sidebar --> CSS/* Sidebar */ #sidebar { float: left; width: 15%; padding: 10px 0px 0px 40px; } #sidebar ul { margin: 0; padding: 0px; list-style: none; line-height: 0px; } #sidebar li { font-size: 11px; line-height: 280%; text-transform: uppercase; letter-spacing: 2px; font-weight: normal; } #sidebar a { display: block; } #sidebar a:hover { text-decoration: none; font-weight: normal; color: #7584BD; background: #F2F2F2 } Very simple really, and used everywhere. I have been looking at free CSS examples to try and solve this problem, but the only so

How to add a new button to the newform.aspx page which says "Save and add another record" ?

Team, I have a scenario where my client wants me to add a nother button to NewForm.aspx page in addition to Save and Cancel buttons. The job of that buttom should be to save the record and open that new form again. Is this possible.If yes can you guie me how to do it though designer? Thanks in advance. Deepti.  

XML Viewer web part and current page URL

Hi, I am using XML viewer web part in 2010. Is it possible to get the current page URL in my XSLT ?  Tried to get this working using a javascript call, but ended up with "scripting is disabled" error. Please suggest. -Karthik  

Web Part Page doesn't show current navigation

Hi! I'm having a problem with the navigation of web part page in Sharepoint 2010. For starters I need to say that I am a web designer and learning to brand Sharepoint 2010 wich means I'm not that tech-savvy so bear with me. We have created an intranet publishing site with Sharepoint 2010 and I have designed a custom master page with styles through Visual Studio 2010. The intranet site looks fine with the new design and I got navigation working with fly out menus, semantic subpages etc. The problem is: when I create a normal page the current sub-navigation is shown and it even shows my created web part page and all is fine, but once I go to this web part page, the left/sub-navigation disappears and I have no idea how to bring it back. The web part page uses the same master file as every other page. Everything with the the layout stays the same as my masterpage, except for the menu wich disappear so I thought it might be some property missing on the sub-navigation. Or do I need to edit something in the web part page layout in the gallery?: Master Page Gallery > BlankWebPartPage.aspx If so can I do it from Visual Studio? Here is the code for the left navigation menu: <!-- styles needed to have left nav to the left of the main area --> <div id="s4-leftpanel" class="s4-notdlg"> <!-- The quick launch bar / left navigation

Links reflecting current page

What would be the standard easiest way to change the css class of the link that is the link for the page that is currently displayed. So that it will reflect on the menu links.Thanks!

Determine the Current Report Rendering Format


I have several reports in SSRS 2005 (SharePoint Integrated Mode) that have Jump to URL navigation links.  The links were working intermittently, and the fix I implemented was to use a Javascript window.open command for the links, and it worked.  However, now the links do not work when the reports are exported to Excel because it doesn't support Javascript.  I'm trying to satisfy the users' requirements of having the links work regardless of how the report is rendered.  Is there a way that I can use custom code to determine the current URL (with query string parameters) so that I can parse it to determine whether the report is currently being rendered as HTML, Excel, PDF, etc.?  If not through parsing the URL, is there another way to go about this that I'm missing?

Thanks in advance,


how to print current page and all pages of listview?



I have a listview.When I click a "Print" button It should be  print only listview items (current page & all pages).

how to do this pls tell me?

many thanks in advance.

how to find any text in current page with java script like (CTRL + F) ie or firefox .



i have a page with datalist and more label

and i have an input text and a html button in my page.

i need a javaScript code for find text in my page like ( ctrl + f ) in ie or firefox . ?!


Checking existence of a record in sql database using IF EXIST and reporting outcome on asp page



I have a page that inserts a record to an sql database and I would like to do the following:

(i) Check if a record already exist before trying do an insert

(ii) If a record exist, the page should be able to inform/display a message in a textbox informing the user that the record already exist.


I have seen a number of post on the internet that suggest that one possible solution is to write a sproc and use the T-sql IF EXIST function. However, I have NOT seen a complete code showing (a) how this can be done (b) how to call the sproc from an asp page (c) and MORE IMPORTANTLY how to display a message informing a user that a record already exist i.e. when the record already exist in the database.


Please have anyone got a complete working code that can achieve this preferably in c#?




Determine if the page required authentication?


I'm using Forms Authentication.  Is there a way to determine whether a page (or request) required authentication or not?  My site has logged-in areas, and logged-out areas (all set in web.config under authorization sections), and I'd like a good way to know if asp.net required authentication to be set or not.

I'm using ASP.Net 2.0

Why do you cast HttpContext.Current.Handler to a page?


I am writing a class (outside of the deafult page webform) and it needs access to a mschart.  The chart is called "Chart1".

I discovered on other forums that in order for a class to access the webform control, you do the following:

System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

Chart Chart1 = (Chart)page.FindControl("Chart1");

But can someone tell me what does the first line do and why does it work?  What is it trying to do?  Why is it setting the context.current.handler to page? and why does it need to be cast to a page?

Secondly, why can't I create the page object by referencing the page class name, which is _Default in this case? (public partial class _Default : System.Web.UI.Page)

Determine if current user is part of audience


How can I determine if the current user is part of an audience or not?

Searching kept bringing me to this link: http://msdn2.microsoft.com/fr-ca/learning/ms499760.aspx  which is unavailable.

Any help or code is greatly appreciated.


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