|
1) I have one custom control Datepicker. In my aspx page I am using that custom control liek the below:
<asp:RadioButtonList ID="rbl" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="1" onclick="ChangeA(this)">a</asp:ListItem>
<asp:ListItem Value="2" onclick="ChangeB(this)">b</asp:ListItem>
</asp:RadioButtonList>
<vv:DatePicker ID="Dp1" Text="StartDate" .../>
<vv:DatePicker ID="Dp2" Text="EndDate">
When the option"a" is selected I have to show the dp1, dp2. When "b" is selected, hide the Dp1, Dp2. So I have the Javascript like the below:
function ChangeA(theradio)
{
document.getElementById('<%=Dp1.ClientID%>').style.visibility = 'visible';
document.getElementById('<%=Dp2.ClientID%>').style.visibility = 'visible';
}
function ChangeB(theradio)
{
document.getElementById('<%=Dp1.ClientID%>').style.visibility = 'hidden';
document.getElementById('<%=Dp2.ClientID%>').style.visibility = 'hidden';
}
I am getting the error "Object required" . for the Dp1, Dp2. If I put the Text boxes insted of Dp1, Dp2 the Javascript code is working fine. How to set visibility for custom control.
2) I have Textbox for which visibility is set to False by design. How to set visibility True using Javascript. My page is having the Master page not HTML body.
For this also I am getting Object required error.
Thanks in advance
|
|
|
|
|
Hey guys, I know this is something really silly to ask but I'm too tired right now to look for it !
I want to have a password field, I can't use a TextBox because it doesn't have the part where I can set the character to dot or star, so I used HTML Input(Password) how can I access it ? I 've given it a name but it's not recognized by Visual Studio !
Mr.K
|
|
|
|
|
You can use the Textbox. Set Property TextBoxMode to Password (http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textboxmode.aspx)
|
|
|
|
|
|
The Request.Forms collection contains all the form fields submitted by the client. HTH
|
|
|
|
|
You also have to be careful with themeing because if you declare a textbox in here you cannot then change it to type password in another page unless it is set to password in the theme page
|
|
|
|
|
I don't really know where else to start looking at this, except here. I need to implement a simple combination of Windows authentication, with custom authorization. I'm supposed to get an employee number from the user's domain login, and then look up authorization for various forms in a custom table. This is all very small scale, so I don't yet want to complicate things by implementing a provider etc. I would just like some guidance on where to start. How do I initialise and use the session in this case?
|
|
|
|
|
I have an online application form that i'm working on. Depending on what selections are made, certain parts of the form are displayed. I use javascript and some css to show and hide the conditional fields.
Also, note that I am using the wizard control to page through the different sections of the form.
The problem i am having is, for instance, when the use presses the back button on the wizard control, the form reloads, and all the fields are hidden. What i want is a way that the user may go back through the form and still have the selected sections still visible.....
Since i'm showing and hiding the form by dynamically changing the css properties ... is there a way to persist these changes through a postback ?
|
|
|
|
|
C. L. Phillip wrote: Since i'm showing and hiding the form by dynamically changing the css properties ... is there a way to persist these changes through a postback ?
I have had this problem and found that there is no way to persist changes. If you can not use Ajax and set the style with server code, there is one hack you can do.
You can save the css values in a hidden element.
For example you could have a hidden span tag
<asp:textbox id="cssValue1" runat="server" style="display:none" xmlns:asp="#unknown">
use javascript to change the value of the cssValue1 when you change css of control.
During the postback set the css of your element to the value you now have access to.
myControl.CssClass = cssValue1.Text;
Do you get what I am saying?
I didn't get any requirements for the signature
|
|
|
|
|
What could cause a Request parameter, passed in a redirect, to go missing? I pass and retrieve the parameter using the following lines of code, yet in the target page, the parameter is empty.
Response.Redirect("~/ConfirmStaffComment.aspx?refNum=" + commentRef, false);
lblFeedbackReferenceNum.Text = Request["refNum"];
My brain fart.
The commentRef was out of scope when I redirected. In the debugger, I checked it was populated, in scope, and assumed it would still be when I redirected.
|
|
|
|
|
Brady Kelly wrote: My brain fart.
Feel better now, Brady?
Brady Kelly wrote: The commentRef was out of scope when I redirected.
I've had that happen a few times in the past. Kind of a bugger to find sometimes
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I actually made it out of scope myself, by adding an extraneous 'string' type declaration at the left of an assignment to the commentRef. Even worse.
|
|
|
|
|
Ahhh, one of those little things that you can put in a blog entry to remember not to do next time
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi everyone,
I really need your help, here is my situation:
I have this visual studio project (in c# .net2) and it's an asp.net application.
I would like that when I click on a button, a javascript is launch on the client side
this javascript must execute and .exe with some arguments
can someone help me code this????
thank you in advance!
|
|
|
|
|
EdgarF83 wrote: help me code this?
No, not without seeing any code you have tried thus far...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have tried a lot but here are the main ones:
(1)
function showDirectory(){
var oShell = new ActiveXObject("WScript.Shell");
var commandToRun = "C:\\Windows\\Notepad.exe";
oShell.Exec("C:\\Windows\\Notepad.exe");
}
//but I don't wont an activex
(2)
function showDirectory(){
SystemProcess spCommand = new SystemProcess();
spCommand.runCommand("C:\\WINDOWS\\notepad.exe");
}
(3)
//this was done in the .aspx.cs file
protected void Button1_Click(object sender, EventArgs e){
System.Text.StringBuilder myStringBuilder = new System.Text.StringBuilder();
myStringBuilder.Append("\n");
myStringBuilder.Append(@"<script language=""javascript"" type=""text/javascript"">\n");
myStringBuilder.Append("SystemProcess spCommand = new SystemProcess();");
myStringBuilder.Append("spCommand.runCommand(C:\\WINDOWS\\notepad.exe);");
myStringBuilder.Append("</script>\n");
string myString = myStringBuilder.ToString();
if (!this.ClientScript.IsStartupScriptRegistered("startCatia"))
{
this.ClientScript.RegisterStartupScript(this.GetType(), "startCatia", myString);
}
}
|
|
|
|
|
Is there a requirement you have for using javascript? You ought to consider if user has javascript disabled.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
well I'm trying to create a program (on a server) that will be launch from remote computers
now these computer are the clients and I want my program to launch there notepad just by clicking a button
that's it ....
|
|
|
|
|
Why are you trying to do this?
Is there no other way?
Even if you are successful, it will be a hack. Scripting done inside the browser is not meant to be able to launch an executable for obvious reasons.
I didn't get any requirements for the signature
|
|
|
|
|
You might want to look into how Apple's iTunes links work.. They are just an ordinary link as part of the Apple website but I assume they call some sort of script.. I don't think it's ActiveX because it works in other browsers aswell as IE.
--Perspx
"When programming in Visual Basic, you can always know whether a given program will become stuck in a loop and never halt. The answer is 'yes'." - Uncyclopedia
|
|
|
|
|
I have an (dotnet ajax)accordian pane inside one of the content of another accordian so what i want to do is to have no border on last pane of the inner accordian and have a border just under the header.
|
|
|
|
|
Hi,
I have a DetailsView control on my page that is the details page of a master/detail set. It grabs the record id from the query string that is passed from the master page. I also have a search box that lets the user search for a new record via an OnClick function. This function just sets the SelectCommand of my SqldataSource to a new query that grabs the text of the textbox used for searching.
It all works great until I hit the edit (which is displayed via the "AutoGenerateEditButton" property) button. When it goes into edit mode the DetailsView looses the record which it currently has (the one from the search) and reverts back to the first record that came from the QueryString.
I have called the DataBind method after the selectCommand on the OnClick call to re-bind the DetailsView but it doesn't fix the issue.
Any insight would be greatly appreciated.
thanks- Frank
|
|
|
|
|
Where you are binding your details view?
If its in page load that could be a problem.
Can you show your page load and button click codes.
|
|
|
|
|
Hi Sherin,
Thanks for the reply. I have tried binding on page load as well as other options. I have also just tried using the FilterExpresssion parameter, which works great in the master page, however, because the sqldatasource for the details page already filters the records via the record id, when i add the filter expression it of course doesn't work because it tries to apply both the record id and the search term.
here is the code I'm using:
protected void Page_Load(object sender, EventArgs e)
{
srcDetails.SelectParameters["recordID"].DefaultValue = Request.QueryString["id"];
srcDetails.SelectCommand="SELECT ... FROM dbo LEFT JOIN dbo. on ... LEFT JOIN dbo. on ... WHERE id = @recordID";
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string val = txtDomain.Text;
srcDetails.SelectCommand="SELECT ... FROM dbo. LEFT JOIN dbo. on ... LEFT JOIN dbo. on ... WHERE name LIKE '%"+val+"%'";
frmDetails.DataBind();
}
thanks. Frank
|
|
|
|
|
How do I have a gridview load with a specific row on the displayed page without filtering out all the other rows. ie if I'm showing 10 rows/page, and the row I want to show is the 37th I want it to load on page 4 instead of 1.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|