.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

The ASP Column: Code-behind in ASPX Files

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

Setup file(*.msi) also includes .aspx.cs (source code) files also


My project is recently migrated from 2008 to 2010

actualy we developed project in VS 2005 in that we created setup file but when we migrated to vs2008 setup file giving problem to us.

now when we make setup file it is including .aspx.cs files also but this if we publish our project it wont including source code.

why setup file including .aspx.cs files is there any way to change.

plz replay ASAP

Code works on aspx but not ascx


Not sure which category to put this question in, so I will put it in here.

Just to give you an idea of the layout of my solution, I have the main project, along with 2 class libraries, BLL and DAL.  (Business Logic Layer and Data Access Layer)

The BLL refers to the DAL and the main project refers to the BLL.

I had a test website and the code worked fine, but the same code will not work on the real project. The only difference is that in the test project, the code was on an aspx code behind, whereas in the real project, it is an ascx code behind (Web User Control )

The code is:

Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString
        Dim recordEntry As New UserRecord(connectionString)
        recordEntry.UserName = "TestName"
        recordEntry.BMI = bMI
        recordEntry.BMR = bMR
        recordEntry.FTM = fTM
        recordEntry.TDEE = tDEE
        recordEntry.TodayDate = dateForToday

Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString

The ASP Column: What's in ASP.NET Config Files?


Even though you've been using ASP. NET for a while, how much do you really know about ASP. NET configuration files? While you've probably touched the Web. config file from time to time, there are some nuances involved in configuring ASP.

George Shepherd

MSDN Magazine September 2004

Code Name WinFS: Revolutionary File Storage System Lets Users Search and Manage Files Based on Conte


One of the monumental problems organizations face today is aggregating information that's stored in disparate formats. Knowledge workers have long wanted to be able to search for content independent of format. The next version of the Windows operating system, code-named "Longhorn," boasts a new storage subsystem that makes that task easier. That subsystem, code-named "WinFS," allows the user to perform searches based on the metadata of the stored item, regardless of what type of file it is or which application created it. This article covers the basic architecture of WinFS and explains how to use the WinFS managed API.

Richard Grimes

MSDN Magazine January 2004

jqGrid with WebMethods in aspx.cs files



here is my code for jqgrid:

/// <reference path="jquery-1.3.2.js" />
/// <reference path="json2.js" />
/// <reference path="jquery.simplemodal.js" />
$(document).ready(function() {

jpg files will not display in gridview on aspx page

I have an image object in a template of a gridview The datasource of the image object evaluates to the path of the jpg file. However, the aspx page displays a little red x instead of the picture. How do I get the image to display/Frank learning vs 2005

Javascript at the end of aspx files. What is the benefit?

Hello,In one of the examples I saw a call to a JS function at the end of the aspx file.Like the following:<script language="javascript" type="text/javascript">   <!--    SetExternal();   // --></script>I was under the impression that the JS functions are either called on onlclick of button events or in the HTML Body tag with Onload.So when an aspx page loads then do you thin the following function which is at the end of the page will be called? and why do we put these functions at the end of the page?Thanks.

Sharepoint: In Calculated Column, Code with multiple "IF" condition does not work.

Implemantation:  Calculate expected resolve date exclude "Saturday" and "Sunday"  based on Priority and Severity.Columns are:1. Priority:2. Severity:3. Raised on: Date record createdCode: Below is the code which contains multiple "If" conditions. For quick undersatnding, i separated major If condition. Below code does not work and sharepoint gives me Sytax error message. =IF(OR(Priority="Critical",Severity="Critical"),IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+3,[Raised on]+1),     IF(OR(Priority="HIGH",Severity="HIGH"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+4, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+4,[Raised on]+2)) ,   IF(OR(Priority="MEDIUM",Severity="MEDIUM"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+3),"dddd")="Saturday",[Raised on]+5,[Raised on]+3)) ) ,   IF(OR(Priority="LOW",Severity="LOW"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+6, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+6, IF(TEXT

External Code Assemblies, Report Subscriptions, and configuration files

I've got a report that relies on a very small external assembly for data for one of its fields.  That assembly, in turn, relies on some values from System.Configuration for portions of its work. I have the configuration keys and values running fine in the web interface, set up in web.config, but when users set up subscriptions for the report it runs fine but doesn't retrieve the configuration values from web.config (as expected) nor does it retrieve them from rsreportserver.config, where I have tried them in the root of the config file as <add key=... /> entries and also by wrapping them inside an <appSettings /> node.  I have also tried them in an appropriately-name config file in the bin directory.  In all cases the report is fine except the field that relies on the external assembly, where I recieve an error indicating that there's missing information (the config vals are used in a String.Format() call): Value cannot be null. Parameter name: format at System.String.Format(IFormatProvider provider, String format, Object[] args) at ExternalDBFunctions.ExternalSelectors.GetNotificationStati(String NotificationID) mscorlib When I remove the config values from the web.config, the web interface shows exactly the same error. Where should these configuration values go?

How do I change the order of column names in EditForm.aspx

I have an Announcements list to which I've added extra columns: Publish (date), De-Publish (date), and Category (choice).  When I go to EditForm.aspx, the columns display in this order: Title , Body, De-Publish , Category and Publish . I'd like to change the order of the columns on EditForm.aspx so that it is Title, Body, Category, Publish and De-Publish . Changing the All Items view doesn't do it. How might I change the order of columns that is shown to the user?

Data from text files, What's wrong with my code?

Hi all, I have uploaded some tab-delimited .txt files on my web site (actually run on my computer, ie localhost, for now), and now I try to retrieve the data from those files. I do this by calling a vb file containg the sub below. Everything works great, except that the sub won't recognise unicode characters. I can split the resulting string using vbnewline and vbtab, but already in the sub in question, the string doesn't understand the Swedish letters åäö, apostrophes and more. Any help would be greatly appreciated! /Pettrer       Shared Function getTextfile(ByVal FullPath As String, Optional ByRef ErrInfo As String = "") As String Dim strContents As String = "" Dim objReader As StreamReader Try objReader =New StreamReader(FullPath) 'UTF8Encoding? strContents = objReader.ReadToEnd() objReader.Close() ErrInfo = Ex.MessageCatch Ex As Exception End Try Return strContents End Function  

How do I get column values in Sharepoint designer so I can use them as a variable in code block?

The code below is in my EditForm.aspx and it works but instead of it outputting "This is just a test!" I need get a number that is stored in a column named Phone Number that has 5555555555 stored in it and have the line that says TD2.innerHTML = "This is just a test!"; ouput what ever number is stored in the Phone Number column. Here is the code that is in my EditForm.aspx <script type="text/javascript">function DisplayItemID(){       var TD1 = document.createElement("TD");       TD1.className = "ms-formlabel";       TD1.innerHTML = "<h3 class='ms-standardheader'>Test</h3>";       var TD2 = document.createElement("TD");       TD2.className = "ms-formbody";       TD2.innerHTML = "This is just a test!";       var IdRow = document.createElement("TR");       IdRow.appendChild(TD1);       IdRow.appendChild(TD2);       var ItemBody = GetSelectedElement(document.getElementById("idAttachmentsRow"),"TABLE").getElementsByTagName("TBODY")[0]; 

Copy of dispForm.aspx and lookup column

Hello, we have created in SPD 2010 a new Dispform. This new dispformuser.aspx is the new default form for viewing list entries. We want to hide some elements with jquery. We are using some lookup columns in our list. When we open an entry in the new form, the lookup-columns looks like <a href="http://s-sharepoint-02.kkrn.local/_layouts/listform.aspx?PageType=4&ListId={1D8EE013-E164-482F-861E-9CACB2EBF6B5}&ID=1&RootFolder=*">Marien-Hospital</a> The form is not customized at the moment, it is only a copy at the moment. Any other colums are ok. Editform and newform seems to be ok, also the lookup columns. Maybe somebody can help us with this behaviour.  thank you Regards Marc

How to use GZIP for aspx, css, and javascript files.

Hi all,I have heard that if we use gzip, aspx files will be loading faster. But, I am not sure as to how to use it in my web applications.I am hosting my site with GODADDY (ASP 2, IIS 7)Can anyone tell me if I will be able to use gzip? Can you give me a sample file where gzip is used?Thanking you in advanceTomy

remove upload multiple files link from upload.aspx..

hi, is there a way to remove the upload multiple files link from upload.aspx..without using any custom coding.

Uninstall error -- The timestamp marker on log files has been set. Error code 0x84B20001

I need to uninstall from the command line for an application we are writing SQL Express 2008.  I am using the following command to debug an error message,   setup100.exe /ACTION=UNINSTALL /INSTANCENAME=SUNKIST /FEATURES=SQL   and I keep on getting an error message:   SQL Server Setup Failure The timestamp marker on log files has not been set.  The timestamp must be set set prior to it being used for the first time.  Error code 0x84B20001   the log files seems to have problems in the following area,    Running Action: SaveFeatureStateAction2008-10-01 15:00:51 Slp: Completed Action: SaveFeatureStateAction, returned True2008-10-01 15:00:51 Slp: Completed Action: ExecuteUninstallCalculateWorkflow, returned True2008-10-01 15:00:51 Slp: ----------------------------------------------------------------------2008-10-01 15:00:51 Slp: Running Action: ProduceStatusLogs2008-10-01 15:00:51 Slp: Error: Action "ProduceStatusLogs" threw an exception during execution.2008-10-01 15:00:51 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: The timestamp marker on log files has not been set. The timestamp must be set prior to it being used for the first time. ---> Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException: The timestamp marker on log files has not been set. The timestamp must be set prior to it being used for the first time. --->

write server side code in External JS files

Salam To All,for my JS code, some times i need to organize my code, so i prefer to put some of javascript functions in external js files and  include it in my page as well.but i am face a problem if i need to write some .Net code especially to Get the Client ID for any of .net controls.so do you have a way to write the following code in External JS file?('#<%= this.ddlMake.ClientID %>').change(function(
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