Click here to Skip to main content
14,390,412 members
   

ASP.NET

 
GeneralRe: What's so bad about webforms? Pin
Steve Naidamast25-Nov-19 5:30
professionalSteve Naidamast25-Nov-19 5:30 
QuestionFacing Issues while reading an excel file and inserting it's rows to a my sql tabble. Working fine in local machine but giving error after deployement Pin
Member 1465772316-Nov-19 4:23
MemberMember 1465772316-Nov-19 4:23 
AnswerRe: Facing Issues while reading an excel file and inserting it's rows to a my sql tabble. Working fine in local machine but giving error after deployement Pin
phil.o16-Nov-19 5:08
mvephil.o16-Nov-19 5:08 
GeneralRe: Facing Issues while reading an excel file and inserting it's rows to a my sql tabble. Working fine in local machine but giving error after deployement Pin
Member 1465772317-Nov-19 8:29
MemberMember 1465772317-Nov-19 8:29 
GeneralRe: Facing Issues while reading an excel file and inserting it's rows to a my sql tabble. Working fine in local machine but giving error after deployement Pin
phil.o17-Nov-19 10:26
mvephil.o17-Nov-19 10:26 
QuestionChange datatable from column to row and bind it to gridview Pin
Anand Solomon14-Nov-19 6:19
MemberAnand Solomon14-Nov-19 6:19 
QuestionAccessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
Member 1115418813-Nov-19 19:34
MemberMember 1115418813-Nov-19 19:34 
AnswerRe: Accessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
F-ES Sitecore14-Nov-19 0:23
mveF-ES Sitecore14-Nov-19 0:23 
If you use the MasterType directive it will let you use strongly-typed master pages. If your master page is;

using System.Web.UI;

namespace WebApplication1
{
    public partial class SiteMaster : MasterPage
    {
        public string SayHello()
        {
            return "Hello";
        }
    }
}


Add the MasterType directive to the top of your content page

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%@ MasterType TypeName="WebApplication1.SiteMaster" %>


In your page you can now access the "SayHello" function on your master page

protected void Page_Load(object sender, EventArgs e)
{
    string text = Master.SayHello();
}


If you don't want to use the MasterType you can still acccess the master page code but you have to cast yourself

var master = (SiteMaster) Master;
string text = master.SayHello();


If you have code in the master page that you need to access from non-page classes then the master page is the wrong place for that code. Put it in its own class rather than the master page.
GeneralRe: Accessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
Member 1115418814-Nov-19 1:17
MemberMember 1115418814-Nov-19 1:17 
GeneralRe: Accessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
Richard Deeming14-Nov-19 2:25
mveRichard Deeming14-Nov-19 2:25 
Question[Solved] Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 1:00
MemberMember 1115418813-Nov-19 1:00 
AnswerRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Richard Deeming13-Nov-19 3:15
mveRichard Deeming13-Nov-19 3:15 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 3:48
MemberMember 1115418813-Nov-19 3:48 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Richard Deeming13-Nov-19 4:36
mveRichard Deeming13-Nov-19 4:36 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 5:58
MemberMember 1115418813-Nov-19 5:58 
Questionwhat is major difference between blazor server app and asp.net mvc razor app? Pin
Nitin Sawant11-Nov-19 19:10
professionalNitin Sawant11-Nov-19 19:10 
AnswerRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
Mycroft Holmes11-Nov-19 21:20
MemberMycroft Holmes11-Nov-19 21:20 
GeneralRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
Nitin Sawant11-Nov-19 23:04
professionalNitin Sawant11-Nov-19 23:04 
GeneralRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
jkirkerx13-Nov-19 10:56
professionaljkirkerx13-Nov-19 10:56 
Questiongridview with dynamic dropdownlist control null exception Pin
Anand Solomon11-Nov-19 5:41
MemberAnand Solomon11-Nov-19 5:41 
Questionvideo calling in asp.net Pin
Member 146439065-Nov-19 19:37
MemberMember 146439065-Nov-19 19:37 
AnswerRe: video calling in asp.net Pin
F-ES Sitecore6-Nov-19 2:04
mveF-ES Sitecore6-Nov-19 2:04 
AnswerRe: video calling in asp.net Pin
Blikkies6-Nov-19 2:28
professionalBlikkies6-Nov-19 2:28 
Questioni want show page numbers in bottom of the page like <1 2 3 4 5.......10 11 12> but it shows <1 2 3 4 5 6 to total> Pin
Member 134445211-Nov-19 21:17
MemberMember 134445211-Nov-19 21:17 
AnswerRe: i want show page numbers in bottom of the page like <1 2 3 4 5.......10 11 12> but it shows <1 2 3 4 5 6 to total> Pin
Richard Deeming3-Nov-19 23:33
mveRichard Deeming3-Nov-19 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.