|
Hello Christian;
Thank you for the reply.
I tried putting an ASP checkbox control on the page ([hidden]width=0,height=0,tabstop=-1) and I can update it.
I displayed it for a test.
My problem is that I am making a call to a class library and passing the control by reference. As I mentioned I could check and uncheck it from the javascript but I couldn't detect its state in the method call to be able to return a bool from the method.
Let me explain. I am trying to implement a javascript confirm dialog and I want to return the value (true/false) from the method based on the button they pressed.
When I displayed the checkbox I could see that it was checked but the method returned a false. The javascript alerts for testing showed that I was in the right condition branch (OK or Cancel button clicked).
Since I can't seem to get the state of the control in the method I was wondering if I could alter a local (to the method) variable from the javascript?
That would be a lot cleaner but I don't know if it is possible.
public static bool Confirm(string msg, ref CheckBox chkbox)
{
HttpContext.Current.Response.Write("<script language="javascript">");
HttpContext.Current.Response.Write("if(confirm('" + msg + "')==true){");
HttpContext.Current.Response.Write("document.getElementById('" + chkbox.ClientID + "').checked = true;");
HttpContext.Current.Response.Write("alert('OK clicked');");
HttpContext.Current.Response.Write("}");
HttpContext.Current.Response.Write("else{");
HttpContext.Current.Response.Write("document.getElementById('" + chkbox.ClientID + "').checked = false;");
HttpContext.Current.Response.Write("alert('Cancel clicked');");
HttpContext.Current.Response.Write("}");
HttpContext.Current.Response.Write("</script>");
return chkbox.Checked;
}
Actually have a backslash (escaped) double quote around the javascript in the language attribute of the script tag, but I can't seem to get the code to show that here.
|
|
|
|
|
Hi All,
I am having an issue with a usercontrol that inherits from a class that uses the Session reference. The error I get is :
Code generation for property 'oIncToSave' failed. Error was: 'Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive'
The code for the property in the inherited class (which also inherits a class which is derived from System.Web.UI.UserControl) is :
public IncDetail oIncToSave
{
get
{
if (Session["IncToSave"] == null)
return new IncDetail();
else
return (IncDetail)Session["IncToSave"];
}
set
{
Session["IncToSave"] = value;
}
}
The error appears each time I make a change to the file (code behind or HTML) and save and/or compile. I can still compile and run the program, but must do it twice (once that gets the error and once to debug), so I would like to know how to get around this. I have other pages that use the same classes without the error.
Thanks for any advice.
Steele.
|
|
|
|
|
I am fairly new to ASP.Net (trained in classic ASP) and in using XML, however I've created a simple XML file which I can see nothing wrong with but when I insert the TreeView control and then try to Edit the DataBindings, there are none in the box! My XML code is as follows:
<BicCodes>
<bic Code="A" Description="The arts">
<bic2 Code="AB" Description="The arts: general issues">
The arts: general issues
<bic3 Code="ABA" Description="Theory of art">
Theory of art
</bic3>
<bic3 Code="ABC" Description="Conservation, restoration & care of artworks">
Conservation, restoration & care of artworks
</bic3>
</bic2>
</bic>
</BicCodes>
Please, please can someone tell me what's wrong with my XML as I'm tearing my hair out here
|
|
|
|
|
This is XML, there's nothing that can be 'wrong' with it. You need to post the code that you expect to read this and turn it into nodes for you.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All!
I am using visual foxpro 9.0 as backend and ASP.NET C# (MSVS2008)AND SERVER2003 OS .
In my application I am trying to populate one database column in the Dropdownlist but i got this error.
Error:
ERROR [42S22] [Microsoft][ODBC Visual FoxPro Driver]SQL: Column 'columnname' is not found.
[link]
http://support.microsoft.com/kb/932201 [/link]
I have try to find lots in google but I got this solution online.Could any one help me ?
Following is Link.
Code
<br />
if (!Page.IsPostBack)<br />
{<br />
String strConnection;<br />
strConnection = ConfigurationManager.AppSettings["ConnectionString"];<br />
OdbcConnection odbcConnection = new OdbcConnection(strConnection);<br />
OdbcCommand odbcCommand = new OdbcCommand("select * from dadmccom order by Name", odbcConnection);<br />
odbcConnection.Open();<br />
OdbcDataReader rd = odbcCommand.ExecuteReader();<br />
while (rd.Read())<br />
{<br />
ListItem listItem = new ListItem();<br />
listItem.Text = rd["Name"].ToString();<br />
listItem.Value = rd["Companyid"].ToString();<br />
RadioButtonList1.Items.Add(listItem);<br />
}<br />
<br />
RadioButtonList1.SelectedIndex = 0;<br />
OdbcCommand odbcCommand1=new OdbcCommand() ;<br />
odbcCommand1 = new OdbcCommand("Select * from dadmitem where Companyid = " + RadioButtonList1.SelectedValue + " order by Itmdesc ", odbcConnection);<br />
OdbcDataAdapter oda = new OdbcDataAdapter(odbcCommand1);<br />
DataSet ds = new DataSet();<br />
oda.Fill(ds);<br />
DropDownList1.DataSource = ds.Tables[0];<br />
DropDownList1.DataTextField = ds.Tables[0].Columns["Sku"].ColumnName.ToString();<br />
DropDownList1.DataValueField = ds.Tables[0].Columns["Itmdesc"].ColumnName.ToString();<br />
DropDownList1.DataBind();<br />
<br />
<br />
|
|
|
|
|
hai friends
i have a page which is the main heart of the users/and project
which requires refresh with interval 30 secs
this page is so lengthy
suppose user is watching the middle part of the page
if the pages is refreshed automatically
then page is comes to top of the page
my requirement is user position should not be changed even the page is refreshed automatically
thanks in advance
vijay
|
|
|
|
|
You could put a position on the URL you navigate to, and read/scroll to that when the page loads.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hai friends
i have a page, in that page user enters his details
and confirms a appointment booking
then he clicks on the "print" button
then he will get a print out which includes
he has got appointment so and so time and day
including the building land mark address
total a text format
note: he should not be redirected to another page
when he clicks on "print" button then the printer dialog box should open
how can i achieve this
plz help me
its urgent
thanks in advance
vijay
|
|
|
|
|
Don't re-post messages. This isn't going to help you get an answer any faster and only clutters the forum. The original message (posted 2 minutes prior to this one with a slightly different subject is here[^].
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines][ Articles][ Blog]
|
|
|
|
|
hai friends
i have a page, in that page user enters his details
and confirms a appointment booking
then he clicks on the "print" button
then he will get a print out which includes
he has got appointment so and so time and day
including the building land mark address
total a text format
how can i achieve this
plz help me
its urgent
thanks in advance
vijay
|
|
|
|
|
vijaylumar wrote: its urgent
I'm sure it is (hence the reason for posting twice).
Add some Javascript code to the "print" button that runs the
print() Javascript function.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines][ Articles][ Blog]
|
|
|
|
|
i want to know the code for pageindexchanged in detailsview
in c#.
With Regards
N.Priya
priya
|
|
|
|
|
Here is Code:
protected void DetailsView1_OnPageIndexChanged(object sender, EventArgs e)
{
DetailsView1.PageIndex = [1,2,3....];
}
But what you want's with this code ?
Parwej Ahamad
R & D with IIS 5.0/6.0
modified on Sunday, June 15, 2008 6:59 AM
|
|
|
|
|
I modified the web.config file as follows:
<pre>
<membership>
<providers>
<add name="AspNetSqlProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="MembershipTest"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProvider"
connectionStringName="LocalSqlServer"
applicationName="MembershipTest"
type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
<properties>
<add name="UIN" type="int"/>
</properties>
</profile>
</pre>
But when register a user,Still request to enter special characters for password.
However, when I modify "minRequiredNonalphanumericCharacters" property in IIS->"asp.net config",
register again, it not request me to enter special characters.
The problem seems to be unread Web.config.
In addition, VS can not recognition "ProfileCommon".
But I recreate a web site, vs can recognition "ProfileCommon" in this new site.
I use VS2008 coding, OS2003 and Vista, in both the above cases has been described.
Have anybody can help me to Analysis and solution?
Thanks.
|
|
|
|
|
Hi,
I am trying to check if an email exists in the database during the registration process. I have created a regular expression with ID ValEmail.
The following code should do the checking but I don't know the correct place for it. CreateUserWizard1_CreatedUser fires only after the account was created.
Any help would be appreciated.
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
TextBox UserNameTextBox = (TextBox)CreateWizardStep1.ContentTemplateContainer.FindControl("UserName");
TextBox EmailTextBox = (TextBox)CreateWizardStep1.ContentTemplateContainer.FindControl("Email");
MembershipUserCollection usersList = Membership.FindUsersByEmail(EmailTextBox.Text);
foreach (MembershipUser userEmail in usersList)
{
if (EmailTextBox.Text == userEmail.Email)
{
RegularExpressionValidator ValEmail = (RegularExpressionValidator)CreateWizardStep1.ContentTemplateContainer.FindControl("REemailExists");
ValEmail.Visible = false;
break;
}
}
|
|
|
|
|
Hi,
Try to CreateUserWizard1_CreatingUser event.
Thx,
Gayani
|
|
|
|
|
Thank you for the advice. As it turns out the membership control has a built in mechanism for it. I just recreated the control and it works.
|
|
|
|
|
Hello everyone........
I am here stuck with problem......
I can search one string from database.........
but cannot search multiple strings from databse........
I am coding in ASP using MS Access
more clearly.........
if one of the record contain name as " david hussey"
and another record contain name as " micheal Miller"
and when I input only "david" or any word I find positive result.....
But If i put "David miller" ,i get no results.........
please tell how to code..........
or what SQL statememt to choose
kundan
ph4ufree@yahoo.co.in
|
|
|
|
|
you could search if the string is LIKE '%david%' OR the string is LIKE '%miller%'
This question belongs in the SQL forum, BTW
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I'm using Visual web developer 2005 with Sql server express 2005 edition. I'm not able to connect to Sql server express 2005 although I'm able to connect to the same using oSql command line utility. I get the following error using the Visual web developer.
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 tried searching on the Ineternet for the same and applied with different combinations but problem persists. Please advise
Thanks in advance!
Don't Quit
|
|
|
|
|
If you have enabled remote connections, this is probably firewall which is blocking the connections.
|
|
|
|
|
N a v a n e e t h wrote: If you have enabled remote connections, this is probably firewall which is blocking the connections.
Hi, Firstly both visual web dev and Sql server express 2005 are on same system. Secondly Firewall is turned off.
Any clues?????
Thanks
Don't Quit
|
|
|
|
|
I have this login page that when a user is authenticated s/he is directed to the main page.The problem is that only Mozilla Firefox actually takes the user to that main page.Internet explorer always take the user back to the login page even when the user is a valid user.I just don't what or why it is so.
The web.config part..
<authorization>
<allow users="?" />
</authorization>
<authentication mode="Forms">
<forms name=".ASPXAUTH" protection="All" timeout="60" loginurl="PerformanceLogon.aspx" slidingexpiration="true" />
</authentication>
<trace enabled="false" requestlimit="10" pageoutput="false" tracemode="SortByTime" localonly="true" />
<sessionstate mode="InProc" stateconnectionstring="tcpip=127.0.0.1:42424" sqlconnectionstring="data source=127.0.0.1;Trusted_Connection=yes">
cookieless="false" timeout="20" />
</sessionstate>
The code behind..
modified on Monday, June 16, 2008 3:49 AM
|
|
|
|
|
what namespace I should add with using system.classname
for Literalcontrol in asp.net with c#
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Just drag and drop from the toolbox. It comes in System.Web.UI.WebControls though.
|
|
|
|