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


Post New Web Links

ASP Classic elements with ASP.NET code behind

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :Windows Application
 

Hello,

I am writing some pages in ASP.NET VB. Based on some database results I need certain pieces of information to display, basically if a column is not null then write out <p>database value</p>. So far, all the databse connection is called in my .aspx.vb file. Rather than have an asp:label (which creates a <span> not a <p> anyway) I was hoping I could keep all my HTML markup front end, so have some ASP Classic code that looks like:

<%

if results.item("name").value <> "" then
response.write("<p>" + results.item("name").value + "</p>"
end if

%>

The problem with this of course is results is not accessible from the front end.

Possibly this is the wrong approach, maybe someone can suggest an alternative if there are better ways. However, I don't like relying solely on Labels, Panels and other built in elements which create spans, divs, etc respectively.

This might sound silly, but there is a reason for this. I need to get some database content into some javascript. Currently I have to load the content into a span (label) which is hidden by css, and then javascript gets the value of this span. I think this is a very poor way of doing things so would prefer to be able to write out exactly when I want it without any unexpected markups.

 

Many T


View Complete Post


More Related Resource Links

What topics cover this code that was written in Classic-ASP?

  
Hey guys,So, I have a very simple bit of ASP on my website currently, which you can check out here:  http://www.marioplanet.com/catalog.aspJust ignore the CSS issue for now! :)Anyway, so, I have a SQL Server table in a database, and I'm pulling some information from it to make a shopping catalog of all my products.I was wondering if there is any need to convert this to ASP.NET, and if I should, as I'm eager to learn how, which topics of ASP.NET does this include?I would assume handling data through a SQL Server Database Table?Also, which ASP.NET framework is best suited for this kind of work?  For the most part, the only ASP.NET code I'm going to be using, is going to be handling data from a database.  Other than a few conditionals and what not.Any ideas and suggestions are greatly appreciated!Thanks!! 

Coding elements in datalist with code behind... Possible?

  
Hey Forumers,I've got a label in the item template tag of the datalist control. The label is bound to an integer column in the data source.What I want to achieve is to retrieve the number from that label and change its text according to what number is retrieved. i.e. if number retrieved = 1 then          lbl.text = "SomeText"My problem is that I don't know how to code that label as it is found in the <ItemTemplate> of the datalist and intellisense cannot identify the label.Is it possible for me to code that label using code behind? or is there any other way to do this?thanks in advanceZephere

controling html elements in controler's code

  

Hi. I'm starting to learn mvc2, mainly because my job requires it.

I had a doubt, that even silly is driving me nuts.  I pick up on the nerddinners examples, following Professional.ASP.NET.MVC wrox book.
but now i'm doing some modifications for my own account.
On traditionl ASP.net it was possible to interact with html elements (divs, textbox, etc... )
On MVC 2 is that possible or any interaction with html must be done with jquery and how?  Because i'm trying to manipulate an html element on my Controller page (DinnerController.ASPX and i had no reference to html div, as i initially supose. 

help?  


can we use classic asp code in sharepoint 2010 content editor or in _layouts?

  

can we use and execute classic asp code in sharepoint 2010 content editor or in _layouts?

We have lots of code in old classic asp which we do not want to recode but just put those pages in _layouts in sharepoint server and execute them somehow. is it possible? We do not want to keep old server where asp code is running now.


Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

  
When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Free Code Snippets - ASP.NET

  
You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

  
Free C# Code Snippets

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Microsoft StyleCop: Source Code Analyzer for C#

  
StyleCop is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while StyleCop analyzes the source code directly. For this reason, FxCop focuses more on the design of the code, while StyleCop focuses on layout, readability and documentation. Most of that information is stripped away during the compilation process, and thus cannot be analyzed by FxCop.

Code spelling checker extension for visual studio 2010

  
Building a spelling checker for source code as an extension for visual studio 2010.

C# and XML Source Code Documentation

  
Through many years of enterprise level software development and consulting, I became critically aware of the importance of good source code documentation, and several years ago when I began working with the first release of Visual Studio .NET beta 1 and found C# provided built-in support for inline XML code documentation, I was thrilled.

How to use getElementById to get the elements in a form

  
There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.

Pocket TV Classic

  
PocketTV Classic is a Free software application that allows you to playback the common standard MPEG-1( .mpg) files on your Windows Mobile Pocket PC or other smartdevice. It is optimized to make use of the latest video acceleration hardware "2700G, ATI" and can playback videos in VGA resolution on VGA Pocket PC's I.E. Axim x51v/x50v, iPaq hx4700, Toshiba e800. A great tool to add to anyones collection.

Bar Code Scanners with the .NET Compact Framework

  
Summary: Learn how to make your applications use bar code scanners in a generic way-ndependent of the specific bar code scanners that are used on different devices. Using the design patterns Façade and Factory, the implementation not only supports multiple bar code scanners, but it also makes it easy to add support for other bar code scanners. After a brief discussion about bar code scanners and the bar code scanner pattern, a download code sample, written in C#, demonstrates the use of the pattern and technologies.

PrinterCE for .NetCF - Code Samples

  
1)Example:Hello World
2)Example:Form Test
3)Example:DrawTextFlow
4)Example:TextColumns
5)Example: Bar Code Test
6)Example:Text Wheel
7)Example:Image Rotation
8)Example:Line Fun

.net code converter

  
For coverting your programming langugae to another languge the below site is very help full

http://www.developerfusion.com/tools/convert/vb-to-csharp/
Categories: 
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