|
sandhya14 wrote: SELECT emp_code as EmployeeID ,emp_code || ' ' || l_Name || ' ' ||
f_Name AS SurNameFirstName FROM emp_master
WHERE ( Reporting_To = PEAP_SelectEmpAppraiser.AppraiserID) and
isnull ( Appraiser , '') = '' and emp_code not
I assume that the Reporting_To, Appraiser and emp_code columns belong to emp_master table.
Also you are comparing Reporting_To column to the column of PEAP_SelectEmpAppraiser table. But this table is not in the FROM clause.
|
|
|
|
|
Hi,
In my content page of asp.net website i have a radiobuttonlist for which i am writing javascript code on its onclick.
i.e. rbt1.items(0).attributes.add("onclick","function1(parameters);")
It was working fine before i placed it inside an updatepanel. But as soon as i placed this control inside updatepanel the javascript function stopped working. Although it still works in firefox but not working in IE.
If anyone can suggest what can be the problem. Is there a problem in html or browser compatibility issue?
Thanks,
sabiha.
|
|
|
|
|
hozsam wrote: Is there a problem in html or browser compatibility issue?
Obviously. I guess the script that is emitted by the ASP.NET AJAX framework differs, or an IE/FF difference is killing it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
so can you pls provide solution for the same. So that it works for both IE and FF.
|
|
|
|
|
<asp:ListView ID="lvCustomers" runat="server" DataSourceID="odsTotalStudents"
onitemcommand="lvCustomers_ItemCommand">
<LayoutTemplate>
<table id="customers" runat="server" class="grid" cellspacing="0" border="0">
<tr>
<th />
<th>
<asp:LinkButton ID="btnSortEmail" runat="server" Text="Admission No." CommandName="Sort"
CommandArgument="admissionno" />
</th>
<th>
<asp:LinkButton ID="btnSortFirstName" runat="server" Text="First Name" CommandName="Sort"
CommandArgument="firstname" />
</th>
<th>
<asp:LinkButton ID="btnSortLastName" runat="server" Text="Last Name" CommandName="Sort"
CommandArgument="lastname" />
</th>
<th>
<asp:LinkButton ID="btnSortGender" runat="server" Text="Class" CommandName="Sort"
CommandArgument="class_section" />
</th>
</tr>
<tr id="itemPlaceholder" runat="server" />
<tr class="pager">
<td colspan="6">
<div class="container">
<asp:DataPager ID="pager" runat="server" PageSize="15">
<Fields>
<asp:TemplatePagerField OnPagerCommand="PagerCommand">
<PagerTemplate>
<div class="command">
<asp:ImageButton ID="btnFirst" runat="server" CommandName="First" ImageUrl="~/images/first.gif"
AlternateText="First Page" ToolTip="First Page" />
<asp:ImageButton ID="btnPrevious" runat="server" CommandName="Previous" ImageUrl="~/images/prev.gif"
AlternateText="Previous Page" ToolTip="Previous Page" />
</div>
<div class="command">
<asp:TextBox ID="txtSlider" runat="server" Text='<%#
Container.TotalRowCount > 0
? Math.Ceiling(((double)(Container.StartRowIndex + Container.MaximumRows) / Container.MaximumRows))
: 0
%>' AutoPostBack="true" OnTextChanged="CurrentPageChanged" Style="visibility: hidden" />
<cc1:SliderExtender ID="slider" BehaviorID="slider" runat="server" TargetControlID="txtSlider"
Orientation="Horizontal" Minimum="1" Maximum='<%# Math.Ceiling((double)Container.TotalRowCount / Container.MaximumRows) %>'
TooltipText='<%# "Page {0} of " + Math.Ceiling ((double)Container.TotalRowCount / Container.MaximumRows).ToString() + " (" + Container.TotalRowCount + " items)" %>' />
</div>
<div class="command">
<asp:ImageButton ID="btnNext" runat="server" CommandName="Next" ImageUrl="~/images/next.gif"
AlternateText="Next Page" ToolTip="Next Page" />
<asp:ImageButton ID="btnLast" runat="server" CommandName="Last" ImageUrl="~/images/last.gif"
AlternateText="Last Page" ToolTip="Last Page" />
</div>
<div class="info">
Page <b>
<%# Container.TotalRowCount > 0 ? Math.Ceiling(((double)(Container.StartRowIndex + Container.MaximumRows) / Container.MaximumRows)) : 0 %>
</b>of <b>
<%# Math.Ceiling((double)Container.TotalRowCount / Container.MaximumRows)%>
</b>(<%# Container.TotalRowCount %>
items)
</div>
</PagerTemplate>
</asp:TemplatePagerField>
</Fields>
</asp:DataPager>
</div>
</td>
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<asp:Panel ID="pnl_Details" runat="server" >
<tr id="row" runat="server" class='<%# Container.DataItemIndex % 2 == 0 ? "row" : "altrow" %>'>
<td class="rownum">
<%# Container.DataItemIndex + 1 %>
</td>
<td>
<asp:Label ID="lbl_StudentAddmission" runat="server" Text='<%# Eval("AdmissionNo")%>'></asp:Label>
</td>
<td>
<%# Eval("firstname")%>
</td>
<td>
<%# Eval("lastname")%>
</td>
<td>
<asp:Label ID="lbl_Class_Section" runat="server" Text='<%# Eval("Class_Section")%>'></asp:Label>
</td>
</tr>
</asp:Panel>
<cc1:HoverMenuExtender ID="HoverMenuExtender1" PopupPosition="Right" TargetControlID="pnl_Details" PopupControlID="pnl_Popup" PopDelay="25" runat="server">
</cc1:HoverMenuExtender>
<asp:Panel ID="pnl_Popup" runat="server">
<asp:LinkButton ID="lbtn_Allot" runat="server" CommandName="Allot" CommandArgument='<%# Eval("AdmissionNo")%>' Text="Allot"></asp:LinkButton>
<asp:LinkButton ID="lbtn_CancelAllotment" runat="server" CommandName="Cancel" CommandArgument='<%# Eval("AdmissionNo")%>' Text="Cancel Allotment"></asp:LinkButton>
</asp:Panel>
</ItemTemplate>
</asp:ListView>
list view hover menu extender not working when mouse hover.can anybody help me regarding this
hi
|
|
|
|
|
Am getting "RPC Server is Unavailable" error .
Any solution
My application is ASP.net + c#
Sabari MD
Application Developer
Veloxit Info Solutions
|
|
|
|
|
Just google it.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
I have three different ways to Instatiate a class and fill the properties.
Even though all three ways work I'm not sure which would be the best to use in the form "Best Practices"
Method 1
Simple instantiate class, set property and call select to fill object
Foo NewFoo = new Foo();
NewFoo.ID = 10;
NewFoo.Select();
Method 2
In constructor Set Id and then call Select to Fill Object
Foo NewFoo = new Foo(10).Select();
Method 3
In the construtor I use the ID and automatically call the Select to fill the Object
Foo NewFoo = new Foo(10);
All three are basically the same. If anyone does it differently or better.
Please let me know what your thoughts are.
Thanks.
|
|
|
|
|
I would use Method 4
Foo NewFoo = new Foo(10);
NewFoo.Select();
|
|
|
|
|
So basically Method 2.
I was kinda going with that.
Thanks.
|
|
|
|
|
Hi All,
i have a custom control like below.
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.IO;
using System.Collections.Specialized;
using System.Collections;
[assembly: TagPrefix("Tittle.Controls", "Tittle")]
namespace Tittle.Controls
{
#region Table Curve Panel Control (Expandable)
/// <summary>
/// Renders a tab control on page. i.e. A tabbed image on top of the table and you can have ur own contents in between that.
/// <example>
/// <code>
/// <Tittle:PanelCurveControl runat="server"
/// Expandable="true"
/// Width="500px"
/// Margin="10"
/// Title="Employees">
/// <table border=1>
/// <tr><td>test1</td><td>test2</td></tr>
/// <tr><td>test3</td><td>test4</td></tr>
/// </table>
/// </Tittle:PanelCurveControl>
/// </code>
/// </example>
/// <autor>Tittle Joseph (tittlejoseph@yahoo.com) India.</autor>
/// <url>http://www.codeproject.com/PanelCurveContainer/</url>
/// </summary>
[ToolboxData("<{0}:PanelCurveControl runat=server Expandable='true' id='tblCrvPnl' Width='200px'></{0}:PanelCurveControl>")]
public class PanelCurveControl : Panel, IPostBackDataHandler
{
private string skinName = ""; //"/BasicNuggetSkin";
private bool hasMinimize = true;
private bool hasPrint = true;
private string imgPath;
private Color bodyBackColor = Color.Transparent;
private string tabBackColor = "#99CCFF";
private string headerTextColor = "black";
public PanelCurveControl()
: base()
{
//imgPath = "/Images/";
}
/// <summary>
/// Makes the control expandable on demand,
/// Default: true
/// </summary>
[Browsable(true),
Category("Validation"),
DefaultValue("true"),
Description("Makes the control expandable on demand.")]
public bool Expandable
{
get { return Convert.ToBoolean(ViewState["Expandable"]); }
set { ViewState["Expandable"] = value; }
}
/// <summary>
/// Render the contents in the box
/// (used only if Expandable is false),
///
/// Expandable true makes tab disappear,
/// but if Expandable is false
/// RenderInBox is "true" shows border of container.
/// RenderInBox is "false" no border appears.
/// Default: false
/// </summary>
[Browsable(true),
Category("Misc"),
DefaultValue("false"),
Description("Render the contents in the box.")]
public bool RenderInBox
{
get { return Convert.ToBoolean(ViewState["RenderInBox"]); }
set { ViewState["RenderInBox"] = value; }
}
/// <summary>
/// Whether the contents of the expandable panel must be visible
/// Equivalent to "DefaultMinimize" attribute
/// Default: false
/// </summary>
[Browsable(true),
Category("Validation"),
DefaultValue("false"),
Description("Whether the contents of the expandable panel must be visible.")]
public bool Closed
{
get { return Convert.ToBoolean(ViewState["Closed"]); }
set { ViewState["Closed"] = value; }
}
/// <summary>
/// The text displayed as the caption of the expandable panel
///
/// Default: "Panel"
/// </summary>
[Browsable(true),
Category("Behavior"),
DefaultValue("Panel"),
Description("The text displayed as the caption of the expandable panel.")]
public string Title
{
get { return Convert.ToString(ViewState["Title"]); }
set { ViewState["Title"] = value; }
}
/// <summary>
/// The margin to use if the panel is expandable
///
/// Default: "2"
/// </summary>
[Browsable(true),
Category("Appearance"),
DefaultValue("2"),
Description("Margin to use if the panel is expandable.")]
public int Margin
{
get { return Convert.ToInt32(ViewState["Margin"]); }
set { ViewState["Margin"] = value; }
}
/// <summary>
/// SkinName to be used in nugget i.e. "BasicNuggetSkin", "BillInfoNuggetSkin", "DataGridNuggetSkin",
/// "TabbedNuggetSkin"
///
/// Default is "BasicNuggetSkin"
/// </summary>
[Browsable(true),
Category("Behavior"),
DefaultValue("BasicNuggetSkin"),
Description("Skinname to be used in nugget.")]
public string SkinName
{
get { return skinName; }
set { skinName = value; }
}
/// <summary>
/// Whether to show Minimize icon on screen or not.
///
/// Default: true
/// </summary>
[Browsable(true),
Category("Validation"),
DefaultValue("true"),
Description("Whether to show minimize icon on screen or not.")]
public bool HasMinimize
{
get { return hasMinimize; }
set { hasMinimize = value; }
}
/// <summary>
/// Whether to show Print icon on screen or not.
///
/// Default: true
/// </summary>
[Browsable(true),
Category("Validation"),
DefaultValue("true"),
Description("Whether to show Print icon on screen or not.")]
public bool HasPrint
{
get { return hasPrint; }
set { hasPrint = value; }
}
/// <summary>
/// Render it minmized by default or not
///
/// Default: false
/// </summary>
[Browsable(true),
Category("Appearance"),
DefaultValue("false"),
Description("Render it minimized by default or not.")]
public bool DefaultMinimize
{
get { return Closed; }
set { Closed = value; }
}
/// <summary>
/// Content Back Color
/// </summary>
public Color BodyBackColor
{
get { return bodyBackColor; }
set { bodyBackColor = value; }
}
/// <summary>
/// Top Tab Back Color
/// </summary>
public string TabBackColor
{
get { return tabBackColor; }
set { tabBackColor = value; }
}
/// <summary>
/// Top Header Text Color
/// </summary>
public string HeaderTextColor
{
get { return headerTextColor; }
set { headerTextColor = value; }
}
/// <summary>
///RaisePostDataChangedEvent::LoadPostData
/// Automatically updates the Closed property based on the content
/// of hidden field named as this control
/// </summary>
/// <param name="postDataKey"></param>
/// <param name="postCollection"></param>
/// <returns></returns>
public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection)
{
bool currentValueOfClosed = Closed;
bool postedValueOfClosed = Convert.ToBoolean(postCollection[postDataKey + "_hdnMinimizeState"]);
// What if the field is empty?
if (!currentValueOfClosed.Equals(postedValueOfClosed))
{
Closed = postedValueOfClosed;
return true;
}
return false;
}
/// <summary>
/// IPostBackDataHandler::RaisePostDataChangedEvent
/// </summary>
public virtual void RaisePostDataChangedEvent()
{
// Do nothing here
// No need of firing server-side events
}
/// <summary>
/// Fires when the panel gets loaded
/// </summary>
/// <param name="e"></param>
protected override void OnLoad(EventArgs e)
{
Expandable = true;
RenderInBox = false;
Title = "Panel";
Font.Name = "verdana";
Font.Size = FontUnit.Point(10);
Margin = 2;
Closed = false;
ForeColor = Color.Black;
BorderColor = Color.DodgerBlue;
imgPath = HttpContext.Current.Request.ApplicationPath + skinName + "/Images/";
base.OnLoad(e);
// Check the browser caps and disable collapse/expand if needed
bool uplevel = false;
HttpBrowserCapabilities caps = Page.Request.Browser;
if (caps.Browser.ToUpper().IndexOf("IE") > -1)
{
// This is IE. But is it at least v5?
if (caps.MajorVersion > 4)
uplevel = true;
}
// If the browser is not IE5 or higher, drop collapse/expand
if (!uplevel)
{
Expandable = false;
RenderInBox = true;
}
//Need to write this, so that LoadPostData() gets called.
Page.RegisterRequiresPostBack(this);
}
/// <summary>
/// Render the control
/// </summary>
/// <param name="output"></param>
protected override void Render(HtmlTextWriter output)
{
if (!Expandable)
{
if (!RenderInBox)
base.Render(output);
else
RenderContentsInBox(output);
return;
}
// Add margin information if the panel is expandable
Style["margin"] = Margin.ToString();
Style["display"] = (Closed ? "none" : "");
// The internal panel must cover 100% of the parent area
// irrespective of the physical width. We change this here
// so that the original Panel code doesn't reflect the
// external width.
Unit oldWidth = Width;
Width = Unit.Percentage(100);
//Add Hidden Field to maintain minimize/maximize state of the curve.
TextBox hdn = new TextBox();
hdn.Attributes.Add("style", "display:none");
//This is what created a big nuisance to me
if (this.UniqueID.IndexOf(":") >= 0)
hdn.ID = this.ID + "_hdnMinimizeState"; //Within some user control or grid //E.g. client id will be in this case "UserControl1__ctl0_tblCrvPnlControl2_hdnMinimizeState"
else
hdn.ID = this.UniqueID + "_hdnMinimizeState"; //Straight on aspx page, //E.g. client id will be in this case "tblCrvPnlControl1_hdnMinimizeState"
hdn.Text = Closed.ToString();
this.Controls.Add(hdn);
// Capture the default output of the Panel
StringWriter writer = new StringWriter();
HtmlTextWriter buffer = new HtmlTextWriter(writer);
base.Render(buffer);
string panelOutput = writer.ToString();
// Restore the wanted width because this affects the outer table
Width = oldWidth;
BuildControlTree(output, this.ClientID, panelOutput);
return;
}
// Handle the PreRender event
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
CreateClientScript();
}
/// <summary>
/// Build the markup for this custom Panel control
/// </summary>
/// <param name="output"></param>
/// <param name="id"></param>
/// <param name="panelOutput"></param>
private void BuildControlTree(HtmlTextWriter output, string id, string panelOutput)
{
Table t = new Table();
//t.ID = "thePanel";
t.ID = id + "_thePanel";
t.CellPadding = 0;
t.CellSpacing = 0;
t.Width = Unit.Percentage(100); //Width;
t.HorizontalAlign = HorizontalAlign.Center;
t.Style.Add("margin", "0 0 0 0px");
// Prepare the topmost row
TableRow rowTop = new TableRow();
// Leftmost cell
TableCell leftCell = new TableCell();
leftCell.HorizontalAlign = HorizontalAlign.Left;
leftCell.Style.Add("width", "10px");
leftCell.Style.Add("background", tabBackColor + " url(" + imgPath + "topleft.gif) top left no-repeat");
leftCell.Text = " ";
rowTop.Cells.Add(leftCell);
//Label Info
TableCell centerCell = new TableCell();
centerCell.Style.Add("background-Color", tabBackColor);
centerCell.Wrap = false;
centerCell.Attributes.Add("onselectstart", "return false"); //Not allowing user to select Tab Title text through mouse or double click.
if (hasMinimize == true)
centerCell.Attributes.Add("ondblclick", String.Format("javascript:MinMaxTableCurvePanel('{0}')", id));
Literal lit = new Literal();
lit.Text = String.Format("<P class=PanelCurveTitleStyle><font color='{1}'>{0} </font></P>", Title, headerTextColor);
centerCell.Controls.Add(lit);
rowTop.Cells.Add(centerCell);
//Print Icon Cell
if (hasPrint)
{
TableCell printCell = new TableCell();
//printCell.HorizontalAlign = HorizontalAlign.Right;
printCell.Style.Add("background-Color", tabBackColor);
printCell.Wrap = false;
printCell.Width = Unit.Pixel(20);
System.Web.UI.WebControls.Image imgPrint = new System.Web.UI.WebControls.Image();
imgPrint.AlternateText = "Print View";
imgPrint.BorderWidth = 0;
imgPrint.Style.Add("cursor", "hand");
imgPrint.Attributes.Add("onclick", String.Format("javascript:PrintTableCurvePanel('{0}')", id));
imgPrint.ImageAlign = ImageAlign.AbsMiddle;
imgPrint.ImageUrl = imgPath + "print.gif";
printCell.Controls.Add(imgPrint);
rowTop.Cells.Add(printCell);
}
//Minimize/Maximize Icon Cell
if (hasMinimize)
{
TableCell minimizeCell = new TableCell();
//minimizeCell.HorizontalAlign = HorizontalAlign.Right;
minimizeCell.Style.Add("background-Color", tabBackColor);
minimizeCell.Wrap = false;
minimizeCell.Width = Unit.Pixel(20);
System.Web.UI.WebControls.Image imgMinimize = new System.Web.UI.WebControls.Image();
//imgMinimize.ID = "img";
imgMinimize.ID = id + "_imgPlusMinus";
imgMinimize.AlternateText = "Minimize/Maximize the Panel";
imgMinimize.BorderWidth = 0;
imgMinimize.Style.Add("cursor", "hand");
imgMinimize.Attributes.Add("onclick", String.Format("javascript:MinMaxTableCurvePanel('{0}')", id));
imgMinimize.ImageAlign = ImageAlign.AbsMiddle;
imgMinimize.ImageUrl = imgPath + (Closed == true ? "plus.gif" : "minus.gif");
minimizeCell.Controls.Add(imgMinimize);
rowTop.Cells.Add(minimizeCell);
}
// Right most cell
TableCell rightCell = new TableCell();
rightCell.HorizontalAlign = HorizontalAlign.Right;
rightCell.Width = Unit.Pixel(10);
rightCell.Style.Add("width", "10px");
rightCell.Style.Add("background", tabBackColor + " url(" + imgPath + "topright.gif) top right no-repeat");
rightCell.Text = " ";
rowTop.Cells.Add(rightCell);
// Add the top row to the table
t.Rows.Add(rowTop);
int colspan = 3;
if (hasPrint)
colspan++;
if (hasMinimize)
colspan++;
// Insert the Panel's markup in the table cell {Container}
TableRow rowBody = new TableRow();
if (bodyBackColor != Color.Transparent)
rowBody.BackColor = bodyBackColor;
TableCell cellBody = new TableCell();
cellBody.ColumnSpan = colspan;
cellBody.Text = panelOutput;
cellBody.Style.Add("BORDER", "#cccccc 1px solid");
cellBody.Style.Add("padding", "0 0 0 0px"); //"0 5 5 5px"
cellBody.Style.Add("margin", "0 0 0 0px"); //"0 0 5 0px"
rowBody.Cells.Add(cellBody);
t.Rows.Add(rowBody);
// Output
t.RenderControl(output);
}
/// <summary>
/// Add client side scripting
/// </summary>
private void CreateClientScript()
{
string jscript = @"
<style>
P.PanelCurveTitleStyle
{
font-family:verdana;
font-size: 12px;
font-weight : bold;
text-align: center;
}
</style>
<script language=javascript>
var imgPath='" + imgPath + @"';
</script>
<script language=javascript>
function MinMaxTableCurvePanel(cntrlId)
{
//Get state from hidden control.
var closed_TableCurvePanel = document.getElementById(cntrlId+'_hdnMinimizeState').value;
if ( closed_TableCurvePanel.toLowerCase() == 'true' )
{
document.getElementById(cntrlId).style.display = '';
document.getElementById(cntrlId+'_hdnMinimizeState').value=false;
document.getElementById(cntrlId+'_imgPlusMinus').src = imgPath + 'minus.gif';
}
else
{
document.getElementById(cntrlId).style.display = 'none';
document.getElementById(cntrlId+'_hdnMinimizeState').value = true;
document.getElementById(cntrlId+'_imgPlusMinus').src = imgPath + 'plus.gif';
}
}
//TODO: this could be improved further to show tab on new window.
function PrintTableCurvePanel(cntrlId)
{
var objDiv = document.getElementById(cntrlId);
var winTableCurvePanel = window.open('','winTableCurvePanelId','');
winTableCurvePanel.document.write('<html><head><title>Print</title></head><body onload=\'javascript:window.print()\'>');
winTableCurvePanel.document.write(objDiv.innerHTML);
winTableCurvePanel.document.write('</body></html>');
winTableCurvePanel.focus();
}
</script>
";
if (!Page.IsClientScriptBlockRegistered("TableCurvePanel_Script"))
Page.RegisterClientScriptBlock("TableCurvePanel_Script", jscript);
}
/// <summary>
/// Render the panel in a box (MSDN like)
/// </summary>
/// <param name="output"></param>
private void RenderContentsInBox(HtmlTextWriter output)
{
this.Style.Add("BORDER", "#cccccc 1px solid");
this.Style.Add("padding", "0 0 0 0px"); //"0 5 5 5px"
this.Style.Add("margin", "0 0 0 0px"); //"0 0 5 0px"
base.Render(output);
}
}
#endregion
}
Now i want to implement idatasource interface into this class.
like below
public class PanelCurveControl : Panel, IPostBackDataHandler,iDataSource
Can anybody help how to implement getview and getviewnames methord of idatasource interface.
|
|
|
|
|
hi there,
i m working on a page that contains a google ad and other server controls
the problem is that when i m placing google ad server control doesn't works
or their events are not called
|
|
|
|
|
In web project application just created I added some class to App_Code folder by means of Solution explorer.
It resides in the same namespace as the web project one.
But from default.aspx.cs I can not access that class reporting error that the object is not defined? but it is in the same namespace and should be visible as in C# projects.
App_Code\SomeClass.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
namespace SomeNameSpace
{
[Serializable]
public class SomeClass
{
public SomeMethod { ... }
}
}
default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
namespace SomeNameSpace
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SomeClass sc = new SomeClass();
}
}
}
Error: The type or namespace name 'SomeClass' could not be found (are you missing a using directive or an assembly reference?)
Чесноков
|
|
|
|
|
Remove the Namespace from both .cs and aspx.cs .... It ll work
|
|
|
|
|
actually not a good idia to remove them. but even in that case it fails
Чесноков
|
|
|
|
|
Try this.
First Create a class in App_Code,like the below
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public class Class1
{
public Class1()
{
}
public string test()
{
return "Test";
}
}
and create the object for that class in default.aspx.cs, like
Class1 cls = new Class1();
and call the function "Test" in default.aspx.cs
string str = cls.test();
Regards,
Karthik K...
|
|
|
|
|
Without any contructors when you type in SomeClass inside default.aspx.cs it is absent in the list of objects available.
Adding constructor does not help. Still the simple declaration of object is forbidden. It is not visible from .aspx.cs
Чесноков
|
|
|
|
|
Chesnokov Yuriy wrote: but it is in the same namespace and should be visible as in C# projects.
Yes,it will work.
Check the namespace. Is it same? May be bymistake you have used different namespaces .Just check that..
himanshu
|
|
|
|
|
Just Create a new ASP.Net project you ll not get any namespace.
ASP.Net .cs files Namespace is not required.
|
|
|
|
|
freshers wrote: Just Create a new ASP.Net project you ll not get any namespace.
Yup that i know..
But still you can manually add namespace to you page
himanshu
|
|
|
|
|
May i know the Need of It
|
|
|
|
|
the namespaces are all the same.
even if I change SomeClass.cs embedded in another namespace, that one also is not visible, even in intelligent help. I can not access SomeClass.cs object in any case??
Чесноков
|
|
|
|
|
it needed to change 'BuildAction' property of SomeClass.cs to 'Compile'
Чесноков
|
|
|
|
|
I am using membership provider DB created using ASP.NET configuration. working fine on my machine.
I after deploying I get the below error when I click login button
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I get Error 26 when I try to run a SqlCommand object referencing the same connection string, but the membership provider works properly.
Is that I need to install sql server on the server or .NET frame work will takcare of it,
I am new to ASP.NET programming/ deploying please help me
|
|
|
|