|
|
First of all, this forum is called ASP.NET, so titling your message ASP.NET is pointless. Next time, pick a more meaningful title.
Second, you have the model the wrong way round in your mind. If you have an area of the website that you want to deny access to someone, then you start off with the idea of denying it to everyone. Okay, once you have this concept firmly in mind, then you grant access to select users. You'd normally do this via roles; add a user to the role and they get access to everything that the role allows. As we don't know what format your underlying authorisation provider takes, I suggest that you should have a read of this[^] section. At the end of it, you will have a much better understanding of what you want to achieve, and how to do it.
|
|
|
|
|
|
hi all,
I am designing a website and I'm using the select control.
I have two question:
firs:how can I undrestand that user selected one options,I think that I should "onchanged" but it doesn't work!
(onchange="salam" and it doesnt call the "salam" function)
second: the number of options depends on the person Id, so it's not constant!How can I control the number of options dynamtically?
as show below
I have used this solution but it dosen't work.
this is the piece of my code!
reader = objcommand1.ExecuteReader();
inti=reader.FieldCount;
while (reader.Read())
{
if (i == 3)
{
</Script>
<option value=""></option>
<option id="post11" value="">0001</option>
<option id="post21" value="">0002</option>
<option id="post31" value="">0003</option>
<script runat="server">
break;
}
if( i == 2)
{
</Script>
<option value=""></option>
<option id="post12" value="">0001</option>
////and this is my another question that how to put the text of option dynamatically
<option id="post22" value=""><script ">
reader.GetValue(1)</script></option>
<script runat="server">
}
|
|
|
|
|
For your first question, you can use the onselectedindexchanged event.
For your second question, if you are storing the option values in a database, you can pull the results based on the person Id and databind it to the drop down list.
|
|
|
|
|
|
Hi,
I have .NET Compact Framework 2.0 application running on a CE device, having no WCF support. I need to consume a WCF 3.5 HTTP POST RESTful service. The WSDL only generates an empty "Reerence.cs" for me. Do I treat this service as a SOAP web servce or just HTTP POS request? Thanks!
Best,
Jun
|
|
|
|
|
<script language="javascript" type="text/javascript">
function forRentClicked(sender) {
var tb1 = document.getElementById('<%= TextBox4.ClientID %>');
tb1.style.display = sender.checked ? 'inline' : 'none';
}
</script>
_____________________________________________________________
<asp:CheckBox ID="CheckBox1" runat="server"
Text=" XS" onClick="forRentClicked(this)" Checked="True" />
<asp:TextBox ID="TextBox4" runat="server" Height="19px" Width="80%" CssClass="123"
style="display:block;" ></asp:TextBox >
how to set the default checkbox uncheck and the javascript can function ~ i want to create 5 check box while i'm click the text box appear~ thx
|
|
|
|
|
Hi Michael,
sorry but i think i dont understand your question...
the Check-Status of an ASP Checkbox can be assigned within the ASP Tag (Checked="True|False")
the Actual Script seems to be hiding showing the Textbox4 independend of other textboxes or checkboxes... So maybe you can give us more details...
Martin
|
|
|
|
|
thx
|
|
|
|
|
I think you of just search for each component and just pieced it together yourself.
function forRentClicked(sender) {
var checked = document.getElementById('CheckBox1').checked;
var textbox_4 = document.getElementById('<%= TextBox4.ClientID %>');
if (checked == true) {
textbox_4.style.display = "block";
}
else {
textbox_4.style.display = "none";
}
}
|
|
|
|
|
thx ~
|
|
|
|
|
Hello Michael5119,
<asp:CheckBox ID="CheckBox1" runat="server"/> has not "onclick"event,you can use
<input id="Checkbox1" type="checkbox" onclick="forRentClicked(this)"/>
to replace it.
|
|
|
|
|
thx ~
|
|
|
|
|
Hi Guys,
I am new to MVC, i have got a situation where i have to support 10 languages in my web application.
I have made some research and found that resource files and routing are the process to accomplish the task.
could you please guide me which is the best way.
Thanks.
|
|
|
|
|
|
This doesn't seem like it should be that hard, so if someone could just give me a kick in the right direction, that'd be awesome.
I have googled for two div bellow code :
$(function() {
var right = $("#center");
$("#toggle").click(function() {
$("#left").animate({ "width": "toggle" }, {
duration: 250,
step: function() {
right.css("margin-left", $(this).width());
}
}, function() { right.css("margin-left", $("#left").width()); });
});
});
#left
{
width: 270px;
float: left;
border: solid 1px red;
}
#center
{
margin-left: 270px;
border: solid 1px green;
}
<pre lang="xml"><div id="left">
Test</div>
<div id="center">
Test Right</div></pre>
now guess that i have three div, i wanna to have same as above.
-------------------------------
|left div|center div|right div |
-------------------------------
the right and left div are always 170 px (for ex.)
and i wanna do that when my left div is empty my center div become bigger (same as below code)
and all three div should be side by side .and when my left div is empty the center div become bigger and right div be side of center div.
Thanks in advanced !
|
|
|
|
|
#left { float: left; }
#main { float: left; }
#right { float:right; }
<div id="left">
</div>
<div id="main">
<div id="right">
</div>
</div>
Try that. I think it will do what you described.
|
|
|
|
|
thanks in advanced but its not working!
In other word :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication1.WebForm2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
#left
{
width: 270px;
float: left;
border: solid 1px red;
}
#center
{
margin-left: 10px;
width: 740px;
border: solid 1px green;
float: left;
margin-right: 10px;
}
#right
{
width: 255px;
float: right;
border: solid 1px red;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<br />
<div id="left">
Test Left</div>
<div id="center">
Test center</div>
<div id="right">
Test Right</div>
<br />
<br />
</form>
</body>
</html>
this is image when i have three divs :
http://i49.tinypic.com/35l85jc.jpg
and when the left div is empty i wanna have like :
http://i49.tinypic.com/24zfwug.jpg
modified 16-Apr-13 0:06am.
|
|
|
|
|
I believe you will need conditional execution to achieve it.
msdn.microsoft.com/en-us/magazine/ee335716.aspx
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
thnaks in advanced but i wanna do without Ajax or ...
Just with CSS only!
Thanks in advanced !
|
|
|
|
|
it is best to place in table,
<table><tr><td><div1></td><td><div2></td><td><div3></td><tr></table>
Then give height, width etc....
|
|
|
|
|
thanks for solution but i wanna to have something like this and increase center div width automatically
Quote: this is image when i have three divs :
http://i49.tinypic.com/35l85jc.jpg
and when the left div is empty i wanna have like :
http://i49.tinypic.com/24zfwug.jpg
|
|
|
|
|
Hi,
Hotmail now made it easy for users to unsubscribe by just one click.
How can I implement this in my ASP.NET & C# page?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hmm: have you bothered to try something for yourself before asking for help?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|