|
|
hi ,
Is there any good javascript editor with IntelliSense ?
with warm regards...
subin
|
|
|
|
|
Visual Studio I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
i want to build a rights based data base driven menu bar using asp.net menu control. There are three user roles; super admin, admin & user. super admin is having all view, add, edit & delete rights though user is having only view & edit right.
can anybody tell me how to create (and maintain & use) table for this or other possible scenarios.
|
|
|
|
|
|
i have table emp with fields
empid int pk
empnane varchar(30)
deptname varchar(30)
salary bigint
commission bit
photo image
i have to display data from database in gridview control and add, delete ,update records in gridview
in gridview empname having textbox control
in gridview deptname having dropdownlist control
in gridview iam having salary having textbox control
in gridview iam having commission having checkbox control
in gridview iam having photo having file uploadcontrol and image control
i want this code in asp.net with c#
|
|
|
|
|
For your requirement you have to use template fields in gridview.
Have a look to to following links..
asp_net_grid_view.
msdn1
Msdn2Cheers!!
Brij
|
|
|
|
|
I need help!!
I am working on a .NET project using C# with SQLServer as database.
I have 10users who access the web site with different user id and password.
Each user is having seperate database.
Based on each user id, i have to retrieve different connection string from web.config.
The same connection string will be used in each page, i access the database.
My question is..
how to retrieve the userid in each page? so that I can use it to retrieve the connection string in each page
rightnow I am retrieving the userid in login page and form authenticating with database.
public void LoginUser(Object s, EventArgs e)
{
bool blnAuthenticate = Authenticate(username.Text, password.Text);
if (username.Text == "AB....")
{
connString = WebConfigurationManager.ConnectionStrings["ABConnectionInfo"].ToString();
}
else if (username.Text == "CD....")
{
connString = WebConfigurationManager.ConnectionStrings["CDConnectionInfo"].ToString();
}
else if (username.Text == "EF....")
{
connString = WebConfigurationManager.ConnectionStrings["EFConnectionInfo"].ToString();
}
else if (username.Text == "GH..")
{
connString = WebConfigurationManager.ConnectionStrings["GHConnectionInfo"].ToString();
}
else if (username.Text == "IJ....")
{
connString = WebConfigurationManager.ConnectionStrings["IJConnectionInfo"].ToString();
}
if (blnAuthenticate)
{
FormsAuthentication.RedirectFromLoginPage(username.Text, false);
}
else
{
lblError.Text = "Your login was invalid. Please try again.";
}
}
bool Authenticate(string strUsername, string strPassword)
{
............
}
I appreciate help from anybody..Thank you
|
|
|
|
|
you can add your connectionstring or userid to session at login page and use the session in another pages MHFARDAD
|
|
|
|
|
Thanx Hussain. As you said, i used Session variable to get the connectionstring.
|
|
|
|
|
If you don;t want to use Session object then declare a Static hash table and put all the Connection string when you get it and retrieve it through out the page
|
|
|
|
|
And how will this improve things? What happens when a connection string is updated in the webconfig? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanx Mr.Biswas. I did fix the problem with session object. But I will keep in my mind your suggesiton and I will use it in the other module.
Thank you
Prasad
|
|
|
|
|
you can use the following code........in C#.net
either put your connection string in web.config under appsettings/connections string section
using System.Configuration;
public static string ConnectionString
{
get
{
//return ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString();
return ConfigurationManager.AppSettings["ConnectionString"].ToString();
}
}
|
|
|
|
|
Did even bother to read the original post? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi
I have a user control, which consists of a gridview and link button. The problem being, the link button won't work! Can someone please have a look and show me why and how to solve it please!
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Collections.Generic.List<UserControlProof.Model.Customer> model = new System.Collections.Generic.List<UserControlProof.Model.Customer>();
model.Add(new UserControlProof.Model.Customer() { Name = "Customer1", address = "Addr1" });
model.Add(new UserControlProof.Model.Customer() { Name = "Customer2", address = "Addr1" });
model.Add(new UserControlProof.Model.Customer() { Name = "Customer3", address = "Addr2" });
model.Add(new UserControlProof.Model.Customer() { Name = "Customer4", address = "Addr3" });
var Addr = (from m in model select m.address).Distinct();
foreach (string addr in Addr)
{
UserControlProof.Controls.CollapseableRecordset cr = (UserControlProof.Controls.CollapseableRecordset)LoadControl("Controls//CollapseableRecordset.ascx");
cr.ID = cr.UniqueID;
form1.Controls.Add(cr);
cr.DisplayName = Addr;
var filterredAddress = from m in model where m.address == addr select m;
cr.DataSource = filterredAddress;
cr.Count = filterredAddress.Count();
if (cr.Count == 1)
{
cr.ViewCustomers = true;
}
cr.DataBind();
form1.Controls.Add(new Literal() { Text = "<br />" });
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
}
}
public partial class CollapseableRecordset : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GridView1.Columns.Clear();
BoundField f1 = new BoundField();
f1.DataField = "Customer";
f1.ShowHeader = false;
GridView1.Columns.Add(f1);
//private string displayName;
public string DisplayName
{
get
{
EnsureChildControls();
return LabelName.Text;
//return displayName;
}
set
{
EnsureChildControls();
LabelName.Text = value;
//displayName = value;
}
}
//private int count;
public int Count
{
get
{
EnsureChildControls();
return int.Parse(LabelCount.Text);
//return count;
}
set
{
EnsureChildControls();
LabelCount.Text = value.ToString();
//count = value;
}
}
//private bool ViewCustomers;
public bool ViewCustomers
{
get
{
EnsureChildControls();
return Link1.Visible;
}
set
{
EnsureChildControls();
Link1.Visible = value;
}
}
public object DataSource
{
get
{
EnsureChildControls();
return GridView1.DataSource;
}
set
{
EnsureChildControls();
GridView1.DataSource = value;
}
}
protected void Link1_Click(object sender, EventArgs e)
{
Label1.Visible = true;
}
}}
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CollapseableRecordset.ascx.cs" Inherits="UserControlProof.Controls.CollapseableRecordset" %>
<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls"
TagPrefix="pp" %>
<asp:Label ID="LabelName" runat="server" Text="Name"></asp:Label>
<asp:Label ID="LabelCount" runat="server" Text="Count"></asp:Label>
<asp:Panel ID="Panel1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
ShowHeader="False">
</asp:GridView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label" Visible="false"></asp:Label>
</asp:Panel>
<asp:LinkButton ID="Link1" runat="server" Text="View All"></asp:LinkButton>
public class Customer
{
public string Name { get; set; }
public string address { get; set; }
}
|
|
|
|
|
hi,
i have developed a web site in vs 2005.
when i execute the website by pressing F5, the site opens, but in the environment [vs 2005] it does not show that it is in the debugging mode. the site opens seperately.
Sandeep Kumbhar
|
|
|
|
|
|
Other than what Abhijit suggested, you can also check whether your Terminal Service is Disabled or not.
Visual Studio Debugger uses Terminal Service internally.
Open Services.msc from Run, and Restart "Terminal Service"
I think this might be one reason.
|
|
|
|
|
Abhishek Sur wrote: Visual Studio Debugger uses Terminal Service internally.
can you please send the source of this information?
|
|
|
|
|
|
HI Guys, i just finished a webapp (RegSolution) on my system. I have another winapp that is a custom web browser. Then, i open localhost default page like this:
wbBrowser.Url = new Uri("http://localhost/");
This works on the custom browser (the default IIS7 page shows). But it doesn't work when i try to open up my custom web app like this:
wbBrowser.Url = new Uri("http://localhost/RegSolution/SignIn.aspx");
There's no error on the page. It loads well on IE7 and Mozilla. But, im my custom web browser, it just takes forever to load.
Pls what can i do?He who goes for revenge must first dig two graves.
|
|
|
|
|
hi,
i am new in asp.net,
i want to create a website for my practice.
can you tell me how can i do that?
|
|
|
|
|
|