|
I think my problem is that I don't have this <%@ Import Namespace="System.Web.Security" %> in my codebehind page.
|
|
|
|
|
Help!
I've got a page that I need to have show a report I've built with the included Crystal Reports tool. I've created the report, added the report viewer to the page, added the report document component, set up the data binding and no go....I get the following error:
Specified argument was out of the range of valid values. Parameter name: value
<CR:CrystalReportViewer id=crvPMReport accessKey="<%# cachedPM1 %>" runat="server" Height="50px" Width="350px">
Any thoughts? The report itself is simply one column of a table, thought I'd make sure it worked before I invested a ton of time in it....
|
|
|
|
|
Hi,
I have an imagebutton and a submit button in my usercontrol. I have few textboxes to enter search criteria. Imagebutton placed before the submit button on the design code. When the user press "enter" key imagebutton's click event is firing, but I want the submit button't click event to get fired. Both are running at server. Both actions pulling data from the database.
Ram
|
|
|
|
|
Here by default imagebutton(whichever will come first) will get fired if you want other button to get fired then you have to use javascript for that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I tried all possibities of scripting, could you send something.
|
|
|
|
|
Two possibilities are there, first you place the control(whose event you want to get fired on enter key) before the other. The second possibility is to use javascript code that will trap the enter key and fire the event. The javascript function to trap the enter key is this:
function TrapEnterKey(field,event)<br />
{<br />
var keyCode = event.keyCode?event.keyCode:event.which?event.which:event.charcode<br />
if(keyCode==13)<br />
{<br />
document.getElementById("BtnSearch").click();<br />
return false;<br />
}<br />
}
Best Regards,
Apurva Kaushal
|
|
|
|
|
|
Hi,
I have created an application running on ASP.Net using C#. I have a panel and a button to print the page.On click of button content of the panel should be printed and not other part of page. Can anyone help me on this, please?
Thank u.
kamalnath
|
|
|
|
|
exactly waht i want to do i want to check that whether a particular string is in the string or not?
like
str ="C:\Inetpub\wwwroot\medicaps";
now i want ot check whether a wwwroot is in this string or not.
thanx
|
|
|
|
|
Perhaps you would like to listen to the advice given on your last post before asking the same question again.
only two letters away from being an asset
|
|
|
|
|
I know C++ had a string compare function, If if available in .Net dont know
|
|
|
|
|
Hi here is the way, we can use "IndexOf" string class method.
string strTest = "I am strong";
if(strTest.IndexOf("strong")==0) { return(false); }
Ram
|
|
|
|
|
Using IndexOf will work but the System.Text.RegularExpressions is a better way, here is an example.
<br />
Private Function InLine(ByVal Line As String, ByVal Value As String) As Boolean<br />
Dim r As Regex = New Regex(Value, RegexOptions.IgnoreCase)<br />
Dim m As Match = r.Match(Line)<br />
If m.Success Then Return True Else Return False<br />
End Function<br />
|
|
|
|
|
Why not just use .Contains()?
|
|
|
|
|
To the best of my knowledge .Contains is not available to string variables. It is for ArrayList and other Collection objects. If this is wrong could you please show me an example?
|
|
|
|
|
|
Will do nicely. It's only available in framework 2.x.
---
b { font-weight: normal; }
|
|
|
|
|
If you need the added functionality that the regular expression offers, it's a better way. If you don't, the IndexOf way is more efficient.
You forgot to escape the value, by the way. And I really don't see the reason to check the value of Success before returning it...
Private Function InLine(ByVal Line As String, ByVal Value As String) As Boolean
Dim r As Regex = New Regex(Regex.Escape(Value), RegexOptions.IgnoreCase)
Dim m As Match = r.Match(Line)
Return m.Success
End Function
---
b { font-weight: normal; }
|
|
|
|
|
I'm still working with 1.1 so that is good to know when I move to 2.0 – thank you. I see your point with using the IndexOf and agree it will provide better performance then the function.
|
|
|
|
|
How do I access a web.config from my web service
I need to grab the connection string of one of many data basis
Regards
|
|
|
|
|
Access it the same way you normally would, ConfigurationManager.ConnectionStrings
only two letters away from being an asset
|
|
|
|
|
Sorry I'm lost here
Bit more info please
Regards
|
|
|
|
|
This What I have done It works fine But I need to get only the one from the default web.config file.
Dim the_string_final As String = ""
Dim the_string_temp As String = ""
Dim counter As String = 0
Dim connectionStrings As ConnectionStringSettingsCollection = _
WebConfigurationManager.ConnectionStrings
Try
Dim connectionStringsEnum As IEnumerator = _
connectionStrings.GetEnumerator()
Dim i As Integer = 0
While connectionStringsEnum.MoveNext()
Dim name As String = connectionStrings(i).Name
Debug.WriteLine(name)
Debug.WriteLine(connectionStrings.Item(i).ConnectionString)
counter = counter + 1
the_string_temp = "****Number: " + counter + " '" + connectionStrings.Item(i).ConnectionString + "'" + "NAME: " + name
the_string_final = the_string_temp + the_string_final
i += 1
End While
Return the_string_final
Catch ex As Exception
End Try
Return the_string_final
The output:
<string xmlns="http://spero.co.za/">****Number: 2 'Data Source=(local);User ID=sa1'NAME: SL2010WSConnectionString****Number: 1 'data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true'NAME: LocalSqlServer
|
|
|
|
|
I Have tried this as well and no luck
Dim rootWebConfig As System.Configuration.Configuration
rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)
Dim connString As System.Configuration.ConnectionStringSettings
If (0 < rootWebConfig.ConnectionStrings.ConnectionStrings.Count) Then
connString = rootWebConfig.ConnectionStrings.ConnectionStrings("MyString")
If Not (Nothing = connString.ConnectionString) Then
Console.WriteLine("Mystring = {0}", connString.ConnectionString)
Else
Console.WriteLine("Mystring")
End If
End If
|
|
|
|
|
WebConfigurationManager.ConnectionStrings["Default"].ToString()
only two letters away from being an asset
|
|
|
|