|
Hi , i learned some stuffs at membership , but it just alow you to allow or deny users depend on their roles from seeing or not a page i repeat a PAGE , but what i actually want is deny or alow them to do something ,
i will explain , i wantto allow the same page to Users that have "Basic" role & also to Users have the "Admin" one , but the admin can see more things , for example the basic user can ust see wires that the machine he work in cut . ut the admin can see the list of all the wires cut in all the factory .
can you tell me how can i do that ? i mean deny the basic user from seeing all wires & alow the admin to do that stuff
there is a radobutton named "All" here i have the problem i don't want te basic user to see that button or whatever the necessary is denying him from seeing all wires
thank you
try to be good if you can't be the best
|
|
|
|
|
Check IsInRole then enable/disable the control as appropriate
only two letters away from being an asset
|
|
|
|
|
please try this (event name) -= (event); see if this can help you
|
|
|
|
|
Salam ,
everybody know that a website is always viewed by a lot of people . each one can do all what he wants in .
assuming i and you and you and .... we want to update someting in our blog or change something or anything that will need a connection to a database , this mean that we will need thousands of connections to access in the same time isn't it ? but it would be a stupide idea to use tousand of conections cuz even if it is reasonable , the database has a limite of connections isn't it ?
but what i can't understand is how all these people can access in the same time
i have this problem in my application , i don't know how have i to declare my connections to let everybody access the data in the same time ?
i hope you undertood my question , can you tell me how please ?
-- modified at 10:51 Monday 18th September, 2006
try to be good if you can't be the best
|
|
|
|
|
By using the same connection string to open your connection you can take advantage to connection pooling, whereby the framework handles allocating the necessary number of connections. By opening and closing the connection only when necessary, and only as long as necessary, you should be able to avoid must problems. Consider also that it is highly unlikely that all users will be updating data at the same exact second.
only two letters away from being an asset
|
|
|
|
|
You use a separate database connection for each request. That's the only reasonable way to handle multiple users. Any attempt to share connections or keep them alive from one request to another will only result in using more resources.
It's true that there is a limit on the number of simultaneous connections, but that is rarely a problem unless you have written bad code. The database driver for Access has a limit of 64 simultaneous connections, and that is sufficient in most cases. If you have so many users that the number of connections is a problem, you have outgrown an Access database anyway.
Well written code minimizes the time each connection is open, so that the server can handle more requests with fewer connections open at the same time. Open the connection as late as possible, get your data, and close the connection as soon as possible.
---
b { font-weight: normal; }
|
|
|
|
|
thnx goffa, but what do you mean by using a separate connection for each reuest ? how can i do that ? i don't know may be you mean using a connection for UPDATE & 1 for select ... ?
can you clearify your idea please ? thank you
try to be good if you can't be the best
|
|
|
|
|
A request is when the browser ask the server for a specific page, so what I mean is that you should create and open (and of course close) a connection object for each single page (that uses the database) that is created on the server.
---
b { font-weight: normal; }
|
|
|
|
|
I think this kind of design pattern can help you:-
using System;
using System.Collections;
using System.Threading;
// "Singleton"
class LoadBalancer
{
// Fields
private static LoadBalancer balancer;
private ArrayList servers = new ArrayList();
private Random random = new Random();
// Constructors (protected)
protected LoadBalancer()
{
// List of available servers
servers.Add( "ServerI" );
servers.Add( "ServerII" );
servers.Add( "ServerIII" );
servers.Add( "ServerIV" );
servers.Add( "ServerV" );
}
// Methods
public static LoadBalancer GetLoadBalancer()
{
// Support multithreaded applications through
// "Double checked locking" pattern which avoids
// locking every time the method is invoked
if( balancer == null )
{
// Only one thread can obtain a mutex
Mutex mutex = new Mutex();
mutex.WaitOne();
if( balancer == null )
balancer = new LoadBalancer();
mutex.Close();
}
return balancer;
}
// Properties
public string Server
{
get
{
// Simple, but effective random load balancer
int r = random.Next( servers.Count );
return servers[ r ].ToString();
}
}
}
///
/// SingletonApp test
///
///
public class SingletonApp
{
public static void Main( string[] args )
{
LoadBalancer b1 = LoadBalancer.GetLoadBalancer();
LoadBalancer b2 = LoadBalancer.GetLoadBalancer();
LoadBalancer b3 = LoadBalancer.GetLoadBalancer();
LoadBalancer b4 = LoadBalancer.GetLoadBalancer();
// Same instance?
if( (b1 == b2) && (b2 == b3) && (b3 == b4) )
Console.WriteLine( "Same instance" );
// Do the load balancing
Console.WriteLine( b1.Server );
Console.WriteLine( b2.Server );
Console.WriteLine( b3.Server );
Console.WriteLine( b4.Server );
}
}
|
|
|
|
|
Hi,
I have a user control which is placed as a left navigation bar. In that column I simply have a table. This table contains many rows and few columns. Those contain links.
What I hope to achieve is toggling the visibility of each row/column on and off when any of the links in them are clicked. Each link ofcourse loads a separate page. Those pages are tied to the same user control.
Thank you for any help.
EDIT [ P.S. Is the solution to toggle the rows/columns from each webform separately? Are we able to control user controls from Webforms? ]
|
|
|
|
|
hi,
yes we can control user controls from webforms,Use properties in user controls,
and you can set the value of these properties from the web form dynamically..
in Usercontrol...
public bool PROP
{
set{_onoroff = value;}
get{return _onoroff;}
}
you can set this value from the webform like.. <UCL:UserCtrl PROP="True" .../>
Luck is Opportunity with hardwork
|
|
|
|
|
How can I run a ASP.NET 2.0 project from localhost, but not to enter tne VS.NET and presws F5 (ctrl + F5) like I can do in ASP.NET 1.x?
Thanks.
|
|
|
|
|
Actually, if you use the IIS to run your ASP.NET 2.0 application, then you can run in the same way as you would with the version 1.x. With the built-in server, you are required to start the server from the command line if you don't want to hit f5 or ctrl+f5.
Web Servers in Visual Web Developer [^]
|
|
|
|
|
Sorry for the delay.
Iam using IIS as my web server.
I've tried to run asp.net2.0 application like I would do in 1.x, but I get an error about xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" so that configuration node doesen't have attribute name specified above (xmlns...).
When I run from VS.NET, it runs OK.
The project structure is:
ProjectName
|
+- ProjectName
| |
| +- Default.aspx
| |
| +- Web.Config
| |
| +- ...
|
+- ProjectName.sln
Maybe this is source of the problem, but Iam not sure becouse I copy the second folder (ProjectName) anywhere in the hdd and create an applcation in IIS management console and it should work (this will work in 1.x), but it doesen't.
Any ideas?
|
|
|
|
|
Hi there,
Are you sure that you pick up the right version of the ASP.NET runtime for your application? In the IIS snap-in, you can right click the application entry and go to the ASP.NET tab, then have a look at the selected version. Also, in the VS 2005, it allows you to create a web site using the IIS instead of the File System (by default).
|
|
|
|
|
hi all,
can anyone guide me in creating an web custom control for wizard control in asp 2.0.
advance thanks
ShadesRulz
|
|
|
|
|
|
hi Satips,
well, the link shows how to create in standalone website.
but am talking how to generate the same thru code.
something like we do in creating web custom control like this
protected override void CreateChildControls()
{
Wizard myWizard = new Wizard();
//myWizard.DisplaySideBar = false;
myWizard.Height = 300;
myWizard.Width = 300;
myWizard.BorderColor = Color.Black;
myWizard.BorderWidth = new Unit(2);
WizardStepBase WIZARDSTEP1 = new WizardStep();
WIZARDSTEP1.ID = "0";
Label first = new Label();
first.Text = "first";
WIZARDSTEP1.Controls.Add(first);
WIZARDSTEP1.StepType = WizardStepType.Start;
myWizard.WizardSteps.Add(WIZARDSTEP1);
WizardStepBase WIZARDSTEP2 = new WizardStep();
WIZARDSTEP2.ID = "1";
Label second = new Label();
second.Text = "second";
WIZARDSTEP2.Controls.Add(second);
WIZARDSTEP2.StepType = WizardStepType.Step;
myWizard.WizardSteps.Add(WIZARDSTEP2);
WizardStepBase WIZARDSTEP3 = new WizardStep();
WIZARDSTEP3.ID = "2";
Label three = new Label();
three.Text = "three";
WIZARDSTEP3.Controls.Add(three);
WIZARDSTEP3.StepType = WizardStepType.Complete;
myWizard.WizardSteps.Add(WIZARDSTEP3);
Controls.Add(myWizard);
}
}
ShadesRulz
|
|
|
|
|
Hi, im new to asp.net and having some trouble with user controls.
The senario is this,
I have 4 files,
control.ascx - my custom control
control.ascx.cs - the codebehind file for my custom control
page.aspx - the page im placing the control in
page.aspx.cs - the codebehind file for the page
I have successfully created the control and placed into page.aspx and it works, the problem is that i cannot access the control from the page.aspx.cs code behind file
assuming the control class is MyControl and the page class is MyPage, if i try to access the control class MyControl from MyPage in the page.aspx.cs codebehind file i get a compilation error saying that the type or namespace MyControl doesnt exist. However if i place the code directly into the page.aspx file it works just fine. So how can i access the custom control classes that i create in codebehind files?
|
|
|
|
|
Can you persist the dynamic control in a web page class's variable so that you can reuse it later? In addition, there are a couple of ways that you can use to programmatically get reference to the control.
Accessing ASP.NET Controls Programmatically [^]
|
|
|
|
|
The problem isnt getting the control into a variable, its getting it as the correct type.
For example if i can get it as a UserControl but then i cant access the customized features of the class for example control.MyProperty = "123" wont work, i need to be able to cast it to a MyControl class. But in the code behind file asp.net cant resolv the class name. It does work fine however if i place the code direct into the aspx file instead of the codebehind file.
e.g. i can use the LoadControl function like this
UserControl c = LoadControl("control.ascx");
but if i try to cast it to MyControl it fails because it can resolve the name MyControl
MyControl mc = (MyControl)LoadControl("control.ascx");
but it only fails in the codebehind file, not in the aspx page its self.
|
|
|
|
|
In the ASP.NET 2.0, you will need to use the @ Reference[^] directive to link to the type of the web user control so that you can access its custom members. Another option is that you can define the custom properties in an interface or a base class and have the web user control implement the interface or inherit from the base class, then you can cast the runtime object to the interface/baseclass.
|
|
|
|
|
Turns out it was a little pequliarity between some asp.net 1.1 and asp.net 2.0 features. I was linking the codebehind file to the aspx page using Src attribute so i didnt have to go compiling the classes all the time but it doesnt seem to like that. Where as if i use the asp.net 2.0 CodeFile attribute which i just found out about then it all works just fine.
Thanks for you help anyway.
|
|
|
|
|
Hi Friends,
I have created some web services. I added them using my local IIS.
Now I want to upload it to my domaing hosting server.
I dont know the proceduere.I cppied my all folders there, now i am trying to add those services into my project using visual studion add web references.
I am connected to internet.
visual studio is not finding those services.
This is first time i have developed web services and trying to develop.
If some one could help me how it will work I would be obliged.
thanks
Naveed Kamboh
|
|
|
|
|
Can you browse manually to the webservices (on your ISP's server) by putting the .asmx url into a web browser?
|
|
|
|