Using Classes In A Webpage?

Aug 13, 2010

I copied this sample class and posted it inside of a website in a folder called APP_Code. The page is called class1.vb.I donot understand Classes at all.How do I use this on a webpage (like the index.aspx page)?

Imports Microsoft.VisualBasic

Imports System.Data

Imports System.Data.SqlClient[code]......

View 16 Replies

Similar Messages:

Visual Studio :: What Is The Difference Between Designer Classes And T4 Template Generated Classes

Jan 11, 2010

I am new to LINQ. when we drag tables we get a dbml file and designer file.

For example DataClasses1.dbml and DataClasses1.designer.cs.

Once we have them then we can start using our LINQ Queries.

In my company project I do not see this designer files and instead there are .tt files which were used as templates to greate ABC.generated.cs files. Is this same as designer class?

View 3 Replies

C# - Class Structure With LINQ, Partial Classes, And Abstract Classes

May 17, 2010

I am following the Nerd Dinner tutorial as I'm learning ASP.NET MVC, and I am currently on Step 3: Building the Model. One part of this section discusses how to integrate validation and business rule logic with the model classes. All this makes perfect sense. However, in the case of this source code, the author only validates one class: Dinner.

What I am wondering is, say I have multiple classes that need validation (Dinner, Guest, etc). It doesn't seem smart to me to repeatedly write these two methods in the partial class:


This doesn't "feel" right, but I wanted to check with SO to get opinions of individuals smarter than me on this. I also tested it out, and it seems that the partial keyword on the OnValidate method is causing problems (understandably so). This doesn't seem possible to fix (but I could very well be wrong).

View 1 Replies

C# - Can Base Classes See The Protected Fields Of Derived Classes

Aug 11, 2010

I don't know if this has to do with how FindControl works or how scope works. But my base class is having a hard time seeing the fields of child classes. Currently I'm planning have the derived class set a property in the base class, but there are a lot of derived classes, so that isn't a very attractive solution.


View 4 Replies

Web Forms :: Using C# Classes Vb Classes Together In VS2008 / 3.5 Project

Mar 24, 2010

Can I use VB and C# classes together in the same 3.5 project?

View 3 Replies

Map Model Classes To ViewModel Classes Or Aggregate Model Classes In ViewModel Classes

Dec 15, 2010

I'm curious as to what people consider better practice, between duplicating model structure in the view model and using a mapping tool to move data between the two, or aggregate the model inside the view model, i.e. have a property on the view model class that is a reference to the actual model. Which is considered a better approach in general?

View 1 Replies

Web Forms :: Whenever Click On Any Button On Webpage, The Request Goes Through, But Nothing Show Up On The Webpage?

Dec 17, 2010

I am working on a financial portal and I am having a problem..I don;t know what to call it so i mentioned it as an 'unknown to me' problem..I have a webpage..whenever I click on any button on my webpage, the request goes through..but nothing show up on the webpage..then If I click on another link and then again come back to previous link,then only I see the results of button_click..


I have a currency conversion and investment after filling up the form in following way and if I click on "INVEST" then nothing shows up..

so now if i click on any other link and go back to 'buy currency' link I see the result as 'investment successful'

View 3 Replies

Php - How To Embed The Result Of A Webpage Into Another Webpage On Another Website

Mar 23, 2010

I would like to allow users to call my ruby on rails app as a service which returns a 'div' with html content in it, and embed that div into their app (which will not be a rails application).

For example, assume someone has their own php website that has a header/footer template that gets rendered, and a content area of the page that they need to fill based on some html I generate in my rails app. I would like to allow them, from php, to call to my website, get the 'div' I generate, and embed that as html in their php page.

What I'm trying to do is host a service on my site that returns some html content, but actually show that content as part of another site, so that the end user only sees the other site and never really knows about mine.

Also, I can use javascript on the client to do this if that is the only way, but I would prefer the php app to handle this at the server if possible so the client gets the html embedded from the original server and it looks like it all was generated by the php script that generated the entire page. I also want to avoid using an iframe.

View 3 Replies

Web Forms :: Displaying One Webpage Content In Another Webpage?

Apr 24, 2010

I developed an application form which includes some textboxes for input. When the user click on the button the following tasks has to be done.

1) If page is valid all data should be stored in database

2) A new webform should appear on the same window and the some content of the application form should be displayed in it.

3) When clicking on browser back button it should not post back to previous page.....

I did the first task..and i don't know the code for the remaining tasks. Here is some information

.aspx button control code


I opened new webform by using Response.Redirect ("submit.aspx"). Where submit.aspx is the form to be opened after data stored upon the button click in application form.

View 9 Replies

Security :: Get URL Of The Webpage That Referred The Request To Webpage?

Aug 17, 2010

am trying to get URL of the page that referred the request to my page, i tried the "





View 5 Replies

C# - Using Sessions In Classes?

Jan 31, 2011

have code that's using session variables; it's both in the master page code behind and in the code behind of some aspx files. I wanted to put this code in a function that's in a different file but when I did that, the statement Session["VariableName"] became underlined in red on the word session. What am I missing?

View 1 Replies

MVC :: How To Use C# Classes In To Views

Jan 29, 2010

I found datetimepicker class in one project . i.e C# project , in this project he/she created one class named as datetimeextensions.cs.

so then he/she imported in to one view and used like this .


i added this class in to my project and i tried to import but it doesn't appear in extensions?

View 4 Replies

Modifying A Webpage From Another Webpage?

Mar 13, 2010

How can I modify a web page from another web page, somthing loke a CMS. In other words, I want to create a web page (Page1.aspx) that a user enters text in a textbox and then clicks a submit button. On code-behind, takes that text and adds it to another page (Page2.aspx) in a DIV tag with an ID="divToModify", similar to what a CMS does.

View 4 Replies

How To Use Appriateness Of Service Classes

Mar 18, 2010

1) I'd like to make use of the built in membership system. Easy enough by itself. However, I wonder if I should still be building an entity around the User and Role classes since they aren't part of the custom database. As such, they aren't part of the domain's aggregate chains either.2) My entities contain the better part of my business logic. For example, my Category entity has the following method: AddForum(User user, Forum forum). All logic tests are performed there and applied, or not, to the private forums collection. What I am wondering about here is the appriateness of service classes. In the traditional mvc style, a service class operates between the controller and repository to perform business logic. With domain design, we do it in the entities. Should I still be using these, now superfluous service classes? Or should I save them for when something is really needed that isn't part of the domain itself, such as an EmailService

View 2 Replies

C# - Using Partial Classes For Validation?

Feb 3, 2011

I'm using Entity Framework to create my data objects. Here's what my designer.cs file looks like:


But my validations aren't loaded. If I try to submit the form with no value for Name, I get an error message saying The value '' is invalid. instead of my error message.

View 3 Replies

Architecture :: Separating BLL And DAL When Not Using Classes

Mar 9, 2011

I'm implementing n-tier structure in the current app I'm working on. Because DataBinding a list of my Objects to a Repeater was far too slow I need to databind a DataTable to the Repeater. Should I still DataBind to a Function (that returns a DataTable) in the BLL that calls a Function in the DAL that returns a DataTable?

View 2 Replies

Including External C# Classes?

Jan 2, 2010

I'm trying to learn ASP.NET programming and here's my first big issue I need to solve:- I like to keep code separate from presentation so I've decided to use code-behing model - I've created default.aspx + default.aspx.cs and everything works nicely- Inside default.aspx.cs, in


I want to instantiate an object where its class is declared in a separate file and is part of a separate namespace. This is a simple PDF generation class that I wish to develop and use in other web and also desktop projects, that's why all these separation.- As a web developer I tend to avoid all kind of IDEs, as a result of this I am independant and I know every line of code in details. Do you think it is possible to bypass VisualStudio and code all the projects by hand? I believe this is quite possible with pure C# code but what about the problem I've described above? Can somebody please write the minimum directive(s) to include an external class or file. (I know about VS 'Add class...', etc. )

View 5 Replies

Accessing Objects From Other Classes?

Sep 7, 2010

In ASP.NET I have a form that has a Textbox named txtOutput and a button. In the main file.aspx.vb I can call a function from the button handler and in that function I can have

txtOutput.Text = "Some Message"

with no problem. I have a bunch of functions in several other classes. For instance I have a class named AbleCommerce that does some database functions. These functions are called from my main class. In those functions, however, I have no visibility of txtOutput. All of my classes are, unfortunately, in the default namespace which I understand is not optimal but didn't seem to impact this issue.

I know this is an easy one I've just not understood properly but it has me stumped. My gut says that I probably need to pass the Textbox object to my "other class" but can't for the life of me figure how.

View 2 Replies

Web Forms :: Get Controls Over Classes?

Jul 21, 2010

i am wondering if i got a label that works out a price in default.aspx and then i want to show it on an invoice Invoice.aspx with Button.Attributes.add("onclick","popup(this)"); with java popup to show my invoice on button click how i am gonna get that label that works out the price to invoice.aspx?

here is my code sample,


View 3 Replies

In C# Or OOP, Should 2 Classes Reference Each Other That Are Related?

Mar 4, 2010

I am working on a class library using C#. I have designed 3 main classes to model our data. They are designed such that class A contains a list of class B instances, and class B contains a reference to a class C instance, ie:


I feel like the class design works well for modeling the data and our business rules, but it does create a few limitations like the above situation. I liked the separation of the PolicyTerm and Billing for the ability to allow that code to be modified and tested independently. Also, I feel like it keeps each section smaller and simpler.

View 5 Replies

Need Reference About Namespaces And Classes?

Mar 27, 2010

what are the namespaces that should be well known by a fresher to initiate learning, what is the main use of a namespace. what is the use of 'args'

View 4 Replies

Determine Which Classes Are Serializable?

Aug 16, 2010

I am changing my ASP.NET app to use a web farm. To do this, I need to change the session state from in-proc to a State Server. To do this, it is my understanding that the classes that are used must be marked as serializable. How can you tell if that is possible with a class? Will you get an error at compile time if it is not possible?

View 2 Replies

To Block IP Address Or IP Classes In .NET

May 23, 2010

I need to block one IP address or class in help me with the code? And how to implement?

View 3 Replies

C# - Classes In A Web Application Dll Crash?

Jun 23, 2010

I converted a ASP.Net website to ASP.Net web app and changed the framework from 2.0 to 3.5

The web application works fine in Visual studio. However, If I compile the app in a dll, and try to reuse its middle layer in another web project, All the classes that have a static variable crash. Code like:

public static string myString = "Something";

However if I convert it to a property like this:

`public static string myString {get{return "Something";}}`

View 1 Replies

Architecture :: Best To Make Classes In VB, VB.NET OR C#?

Nov 29, 2010

1. Desktop based application - Developed in VB2. Web based application - Developed in Asp.Net 2.0 and C#The above two uses same database in SQLI do have proper class library/business logic in desktop based application in VB. Now I need to use the same library in web based application so that I can change at one place and both the versions will work fine with replacement of one dll.hat is the best to make classes in VB, VB.NET OR C# so that I can use at both end easily.1. If I write Activex dll in vb, the internet articles tells about low performance because of Interop services.

View 2 Replies

Copyrights 2005-15, All rights reserved