MVC :: Access A Class Function From A View?

Feb 23, 2010

I have in my Models folder a Class named "Utilities".

I need to acces one method of that class inside a view, like <%if(IsASelectedCategory(item.categoryId, item.productId))%>

View 1 Replies


Similar Messages:

Access :: Data Access Class / Helper Class For Access Databases?

Mar 15, 2011

recommend a data access class / helper class for Access databases, similar to the sqlhelper class found in the (Data Access Application Block)?

View 6 Replies

C# - How To Access A Private Data Members Of Base Class In The Derived Class

Aug 20, 2010

Since we can access the private data member of base class in the derived class with the help of friend function. How can we do the same in C# asp.net? I mean whats the alternative of friend function in C# asp.net

View 2 Replies

Creating Strongly Typed View Showing Big List In View Data Class?

Nov 30, 2010

When I am creating Strongly Typed View I get lots of Classes in View Data Drop down. Classes like Automapper, ninject, Interface..., latebound... Due this its very hard to find my project classes. Is there any way to restrict dropdown to only display my project classes?

View 1 Replies

How To Access Label In Parent Class Of Code Behind Class

May 24, 2010

I have a class (name PageBase) that is inhariting System .Web.UI .Page and all my .aspx page behind classes are inhariting this class. This way I have put some common things in PageBase class.

For showing errors I want to put showMessage funtion in PageBase as well so that I may have not put it in every page and it will easy to manage this way.

Probem is that how PageBase class will access a control which is in aspx page in its child class (child class of PageBase) .

I dont want to pass control as argument to function in parent class, is ther any other way ?

View 7 Replies

How To Access The Instance Variables Of One Class To Be Used In Another Class

Sep 15, 2010

Suppose we declare and define the variable in one class let say FirstClass and we want to use that variable in another class let say SecondClass which is outside of FirstClass .how to do this?

View 2 Replies

Access :: Use Sum Function In Access Database (not MS SQL) To Add Array Of Items In A Particular Date?

Aug 19, 2010

I want to use sum function in access database (not MS SQL) to add array of items in a particular date.For Eg. The Access Database format like

Date
Prod. Name
Value

[code]...

View 4 Replies

Access :: How To Check Duplicate In Form View Insert Before Inserting In MS ACCESS

Aug 21, 2010

I want to Check Gr #(PK) of student wheter exist in table or not id exist show Msg in Label after lost focus from text box .. I tried AutoNumber in Access but it showing error while insertion
Note : im using form View control for insertion...

View 1 Replies

Access :: Retrieve Image Stored In Access Database Using Grid View

Jun 7, 2010

i am using the following code for a retrieving a image stored in access database

View 12 Replies

Calling Function From VB.Net Class?

Mar 11, 2011

Just wondering how I do this, Im creating a class that will have my common database functions. So for example I've created a function db_con in a class called db_functions.How do i use that db_con function in for example my homepage vb code?Do I import the class? I've tried typing the full class and method name, no joy so far?

View 1 Replies

Refer Shared Function In Its Own Class?

Mar 2, 2010

how to refer shared function in a class , this function itself inside same class

public class cls1

Public Shared Function getDBDate(ByVal pDate As Date) As String
Return Format(pDate, "yyyy-MM-dd")
End Function

Private Function GetDb_Format(ByVal pDateString) As String
Dim d As Date = Me.ParseDate(pDateString)
Return clsDate.getDBDate(d)

End Function

End Class

can i have any other way to use getDbDate function

View 2 Replies

C# - Add Function To Built-in Class Using Inheritance?

Mar 21, 2010

I'm trying to add a IsImage property that I wrote myself to the HttpPostedFile class, so that if a user is uploading a file, I can do something like this:FileUpload1.PostedFile.IsImageHow can I do that in C#?

View 1 Replies

Architecture :: What Is The Function Of Abstract Class

Oct 24, 2010

what is the function of abstract class, why design pattern need to build BLL and DAL

anyone give an example for my reference as I am getting strat to build my web-based project

View 3 Replies

Accessing A Class Properties In Function?

Apr 15, 2010

I am unsure of how to reference the properties of my class in a function. Here is how I see it in my head, but how do i go about this?

WebService.vb

[Code]....

UserClasses.vb

[Code]....

View 4 Replies

Putting A Function In Class Instead Of Code Behind?

Jan 7, 2011

I have a function in a code behind file that's used to respond to a gridview event:

protected void GridviewEval(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
foreach (TableCell cell in e.Row.Cells)
{
if (cell.Text == "0") { cell.Text = "-"; }
}
}
}
It's currently in the code behind of a page and I'll be using it in other other pages.I would like to use the same code in other pages.When I cut and paste the function into a class,it's not working.

View 2 Replies

Web Forms :: Access A Control In Another View From A Different View

May 6, 2010

I have an multiview with two views in that and i am trying to access a control in view2 from view1. Like i have a treeview in view1 and and when the treeview gets clicked the iframe in the view2 gets loaded with the document.

View 2 Replies

Web Forms :: How To Write A Function To Return A CSS Class Name

Jan 24, 2010

I'm new to C# and ASP and can't seem to figure out how to write a function to return a CSS Class name.

Here's what I have so far:

In "MyWeb.master" I have a line that reads:

<asp:HyperLink ID="HyperLink1" text="xxxxx"
cssClass='<%# MyCssStyle("ddd") %>'
NavigateUrl="http://www.RDRR.com/Catalog.aspx?TribeID=1"
runat="server" />

And in "MyWeb.master.cs" I have a routine within the partial class that reads:

public string MyCssStyle(string myInput)
{
myInput = "NavigationBarUnselected";
return myInput;
}

This code does not throw an error, but neither does it return a value. What have I missed?

View 8 Replies

How To Set Datasource Gridview To Linq In A Class Function

Aug 4, 2010

i have my page who load my gridview as: GRW.datasource=className.List2(2);i have this function in my class

[Code]....

it returns an error , cannot convert single result to queryable!! in " blo= DB.MarketList(TypeID);"

View 10 Replies

Security :: Add Delete Function To 2nd Class File?

Jan 7, 2011

We are using ASP security on the site, i found months back a tutorial on implementing a pretty simple management page that allows you to create, edit, delete and add roles as well as adding users to roles from 1 page..

It has been working fine, but we added our own security matrix to the site, everything that has to do with the ASP side of the security works as expected and no issues or concerns.. but with our matrix in place, i need to tie the 2 together for 1 thing.. the deleting of a user..

The delete function works great.. but i would like to add my delete to that function so that the users security matrix is deleted as well when their account is done.

Within the class that is handling all the membership functionality, there is this portion tha handles the deleting, i would like to add a call to my class that has the delete method so that when you click delete, the membership account as well as the matrix record is deleted. Since the delete is already setup within my 2nd class, how can i call it to execute it from within the first class?

[Code]....

View 3 Replies

C# - Reference An ASP Control Inside A Function Or Class Method?

Oct 7, 2010

How do you reference an asp.net control on your page inside a function or a class.
private void PageLoad(object sender, EventArgs e)
{
//An example control from my page is txtUserName
ChangeText(ref txtUserName, "Hello World");
}
private void ChangeText(ref HtmlGenericControl control, string text)
{
control.InnerText = text;
}
Will this actually change the text of the txtUserName control?
I tried this and is working
private void PageLoad(object sender, EventArgs e)
{
ChangeText(txtUserName, "Hello World");
}
private void ChangeText(TextBox control, string text)
{
control.Text = text;
}

View 2 Replies

Make Asynchronous Call In Static Class Function?

May 17, 2010

is it possible to make an asynchronous call to a static class function?

View 3 Replies

Function To Send An Entire Class To A Store Procedure?

Jul 13, 2010

I have been working a in a function to send all the properties of a class to a store procedure in any DB. I made it work when i define the specific class in the declaration of the function like this:

protected Boolean LoadDataDB(Class1 objClass1,Type t,String StoreProc)

But what i want is to make this function as generic as posible. I thought on replace the "Class1 objClass1" part with something like "object obj" but it didn't work. If Ipull this of, it will be very usefull for me. Up next i'm copying what i have so far.

[Code]....

The error appears in the wrap.AddInParameter line, in the following code:

objeto[Prop.Name.ToString()]

And it says something like "Can not apply indexing with [] to an expression of type object"

View 2 Replies

VS 2010 - Passing Image Control To Function In A Class?

Oct 31, 2012

I wrote a function in code behind of the aspx file to get from an SQL database the imageurl and assign it to that image's URL. This works fine so I decided to move it to a class but now the imageurl does not exist because the passed image control is now refering to system.drawing.image not the web image.

Code:
Public Sub ShowCodeImages(sProdCode As String, ByRef imgCode As Control, sConnectionString As String)

Dim sSQL As String
Dim sqlDCStock As New SqlConnection
Dim sqlDAStock As SqlDataAdapter
Dim sqlDTStock As DataTable

[Code] .....

View 1 Replies

Web Forms :: Call Function From A Class In Button Click Event

Mar 26, 2016

I wrote this code in class.cs. But I want call it’s from default.aspx.cs

public ArrayList GetInfos(string NAM)
{
ArrayList list = null;
if (ViewState["ArrayData"] == null)
{
list = new ArrayList();
string str = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;

[Code]......

View 1 Replies

Web Forms :: Using File Upload Control - Place Function In Class Library?

Mar 5, 2010

I am using file upload control in aspx page. I want to put file upload logic in class library. but not getting how to distribute logic.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved