.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

Beyond codebehind - need a point in right direction

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net
I bought a book and wrote some code. Spaghetti code done in codebehind on each aspx page that would probably get a good chuckle on here. The bad thing is that I used some session variables to pass things between pages. They work but on rare occasions, not correctly. I want to get more professional and write a class file in the app_code folder, but Im not 100% sure on just a few points. I want to pass an id in the URL and on each page, pass this to the class, and based on this id, return the variables for use where I was using session variables. It will be multiple variables from one query based on the id. This is the part Im fuzzy on. Am I trying to return objects or out parameters or what? Im looking at this link and it seem relevant: http://www.dbtutorials.com/retrieve/retrieve-custom-object-vb.aspx If based on my description of what I want to do, someone could tell me the direction I need to head in, I would so appreciate it.

View Complete Post

More Related Resource Links

Getting Started - Point Me In The Right Direction



My department would like to implement Sharepoint 2010 as a collaboration tool. Specifically, we have researchers who we would like to announce their research projects on Sharepoint. At this point, other people would express interest in working on the project, and Sharepoint would be used as a discussion board, shared calendar, manage documents including features like track changes, versioning, etc, and other tools that would be beneficial to the communication of the team. We would like the finalized report of the project to be submitted such that a copy could be stored for future references. The next step would be to brand Sharepoint so that it doesn't look like Sharepoint, potentially into a public facing website for anonymous users to have limited access.

Being completely new to the administrative side of Sharepoint, I am lost in the clouds. From what I understand, the test bed that has been set up is Sharepoint 2010 Foundations and I have full control to a site. I considered creating subsites for each team and having a links list on the home page as an announcement board. However, I would like to restrict the controls the user has so that learning to use the system is as easy as possible. Would someone let me know the most practical way to implement a solution for the above situation?


learn basic about share point.

This learn basic about share point.

how to set break point at inline code

I set the element height value by using inline code 
<%# Eval("s") %>
where "s" is the variable declared in page load event. when i run the application it don't set the height. 
Is there any way, i can set break point into .aspx file. i mean how i can check if my Eval("s") get the value.  

Changing direction of pop-ups/alerts in RTL


Hello All,

I am not able to change the direction of popups/Alerts in Arabic culture which should be RTL direction.

Rest of my application is changed in above culture, only problem is with popups and alerts.

Thanks in advance.

Extreme ASP.NET: Codebehind and Compilation in ASP.NET 2.0


As I write this column, the release candidates of the Microsoft® .NET Framework 2.0 and Visual Studio® 2005 have just come out, and by the time you read this, they will both already be on the shelves. It feels like it's been a long time coming.

Fritz Onion

MSDN Magazine January 2006

ModalPopup/UpdatePanel from codebehind, inconsistent behavior onClick


First post bear with me please:

I have a simple form with a list of linkbuttons, each fires the same onclick event which sets an indicator image.  I have a dummy button with style="display:none" which I have set as the TargetControlID of the modal.

onClick event from the imagebutton, the modal is shown via modal.Show().  The cancel button inside the modalpopup fires an event which turns off the indicator image and hides the modal via modal.Hide(). 

The events fire perfectly, it's very simple!  Although after doing some testing I noticed the modalpopup is not presented after the 6-10th cycle of clicking the open event, then clicking cancel.  The grey background appears but it is behind the main panel and the modal is either presented behind this or is just simply not displaying. 

I spent hours researching various methods, implemented the CancelControlID to see if it was somehow tied to my call of modal.Hide() that fails.

This occurs with an updatepanel only.  The behaviour is much cleaner this way, so I would hope to be able to implement this.  I have basically eliminated everything but these two events!  Please help

Primary Key In Share Point 2007/ 2010


Can I create 3 columns Primary key in a list using the MOSS 2010 or 2007

Actually My requirement  is

I collect some information by Country,State,Dist wise Temperature


1.  India-Andraprades-Hyderabad-Temp-30

2.  India-Andraprades-KarimNagar-Temp-30

here first 2 column is Same but 3rd column is different that's I required 3 column is Primary Key


Any one help me.



How to work around Share point accessibility requirement ?



I am somewhat new to things related to accessibility in SharePoint. I am trying to work on section 508 accessibility requirements for SharePoint site. I have tried to see few articles from the internet and still looking for more information on the subject matter including what to consider fro preparing requirement.  

I am looking to know what is possible and what is not with SharePoint?

How to achieve all the possible accessibilities in SharePoint?

Is it possible to make accessible all site types (Publishing, team sites,.)?

Please help me in understanding everything around SharePoint accessibility and first in preparing the requirement document. I have tried to see AKS site but there were some issues that are not clear for me at this level.

Thank you in advance,


Is MSDN uses Share point?



Is MSDN uses Share point?


Not able to edit user profile in share point


Hi ,

I am new to share point, and not able to edit user profile data in sharepoint2007. I am getting an error "can't edit the property try with user profile services".

I have ran full crawl still getting the same problem. Also let me know how I can fetch data from Active Directory to share point 2007.



How to create WSP or Package for workflow in Share Point 2007?



I am working on SharePoint 2007. I have created 2 List called "Config List" (this is a list) and "Vacation Form" (this is form library & form designed in infopath). I have also created a workflow on form library "Vacation Form" in Share Point Designer 2007.

With the use of this workflow I am creating some task and updating "Vacation Form".

Now I want to deploy these three thing (Config List, Vacation Form & workflow) on other server.

How do I create a package or WSP file to install these things on different server.


G. Goyal

Share Point integrated SSRS reports rendering when access from external site


Our client has a SharePoint (moss2007) site on Windows 2008, SQL2008 R2 Enterprise, and Reporting service is integrated with SharePoint

The authentication on the share point integration is set to windows, else the authentication for the SSAS datasource gives and error

The extranet zone ( forms) and intranet (Customer Forms) and default (Windows) zones are all access from inside the firewall and the reports render in each with no issues, as the datasources are configured to pass a sql username and password.

However, report rendering is a problem from the internet (external site), the following error is displayed:

An unexpected error occurred while connecting to the report server. Verify that the report server is avai

Point of sale


Hello all!!

I'm Requiered to build a web app thats almost like a point of sale, but web based. Thats cool, but i'm stucked with the part where you select items and put them in some sort of shopping cart, all in the same page. What components would you guys use to do something like this.

Thanks in advance!

Share point website connection with Certral administration


Here is the situation , although I have SBS server 2008 I posted this same problem there , but I want here also to ask.

I followed link http://technet.microsoft.com/en-us/library/dd548330(WS.10).aspx and here are the  results.

In SBS console there is companyweb and it is marked as online. DNS also has entry for companyweb and nslookup works.  When I try to recreate internal website , which is described as 2nd step, my IIS server  is started, in IIS7 my website is running, but when I try to see in central administration if my site exist (web application list)  it isn't listed. So I tried to recreate it and I  followed directions from upper link in section repair user access to the internal website but when I want to delete web site , it is not listed. And after when I want to extend I cannot once again because it is not listed. Any suggestions and is there an

Binding with objects using codebehind



How can I bind an object to a dropdown list or gridview ? I am writing an application where my code behind calls an instance  and bind the list to either dropdown or gridview.

For example:

.aspx page:  default.aspx

<asp:dropdownlist  id="dd1"   runat="server" />



Code Behind:  default.VB

Partial Class Services_Default

    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As   System.EventArgs) Handles Me.Load

      Dim objlist As New services()

         Dd1.datasource = objlist.GetServices()

         Dd1.datatextfield = ?

         DD1.datatextfieldvalue = ?



End sub


End Class



APP_CODE :  Service.VB

    Public Class Services

    Public Function GetServices()

    Dim mylist As New Arraylist()

    Dim myconn As New SqlConne

how to call thickbox function in codebehind



i want to call thickbox.js function in codebehind , below the code in jquery

i want to call below code in codebehind

function tb_remove() {
    if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
        $("body","html").css({height: "auto", width: "auto"});
    document.onkeydown = "";
    document.onkeyup = "";
    return false;

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