|
I have created a usercontrol having a dropdownlist together with other functionality. I need to set the selectedindex of the dropdown from the values saved in the database. Although the value is passing successfully to the set value, however am not seeing the values shown in the dropdownlist. Any ideas? Following is a snippet of my code;
Private _selRequest As Integer
Public Property RequestValue() As Integer
Get
Return _selRequest
End Get
Set(ByVal Value As Integer)
_selRequest = Value
Me.drpPersons.SelectedIndex = _selRequest
End Set
End Property
|
|
|
|
|
Hi,
try checking the page load event of your page that is using this control. see if u have if(!IspostBack) in your page load. or
try to add a public function to set the dropdown in the control.(set property should would be same but still u can give a try)
Regards,
Anil
|
|
|
|
|
I'm writing a web service in .NET that will expose Enumerations to the caller. I know this is possible, I just want to know if it's a good idea. I want to make it inter-operable with other systems, so would exposing an enum work ok? Specifically it will expose a custom object that has an enum inside it as a public property. Many thanks!
PS. to see the web service in action visit http://www.dominicpettifer.co.uk/coolApps/whereAmI.aspx[^]. IP Location mapping, not very accurate though.
|
|
|
|
|
I have created a public custom class which I exposed through a web service before and have not experienced any problems with it. As long as you make sure that you are not exposing sensitive data, you should be okay. About making it inter-operable with other systems, I am not sure. I've never tested that, but in theory I believe it should work.
Hope this helps you.
|
|
|
|
|
Hello,
VS 2005 SQL 2005
I would like to change the connection string dynamcially during program run-time. But get the code to work. There is no run-time errors and the code compiles ok. However, the code does not let me get the connection string, and I would like to update the connection string at run-time.
This is my code in the web.config file.
<br />
<connectionStrings><br />
<add name="ServiceMasterConnectionString" <br />
connectionString ="data source=dev01; initial catalog = serviceMaster; user id=; pwd="<br />
providerName="System.Data.SqlClient"/><br />
</connectionStrings><br />
The code in my website that is used to retrieve the website is as follows:
<br />
imports system.configuration.configuration<br />
<br />
Dim rootWebConfig As System.Configuration.Configuration<br />
rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Incidents/")<br />
Dim connString As System.Configuration.ConnectionStringSettings<br />
connString = rootWebConfig.ConnectionStrings.ConnectionStrings("ServiceMasterConnectionString")<br />
incidents is the folder that contains the web.config file. That has a virtual path in the IIS.
Can anyone correct if I have done anything wrong in the code above,
Many thanks in advance,
Steve
|
|
|
|
|
You might want to reconsider placing the configuration information in another database or XML File rather than the web.config.
Also when you change web.config, the application resets and will want to recompile.
|
|
|
|
|
<connectionStrings>
<add name="MyConnString" connectionString="Data Source=localhost;Initial Catalog=MyDB;User ID=**;Password=**;"
providerName="System.Data.SqlClient" />
</connectionStrings>
ConfigurationManager.ConnectionStrings["MyConnString"].ConnectionString
only two letters away from being an asset
|
|
|
|
|
I want to create table at runtime for an existing Ms Access database using ASP.net 2.0 and C#. Can anyone please guide me through it ?
|
|
|
|
|
arpita2006 wrote: ASP.net 2.0
ASP.NET will not help you because that is a technology for web applications. ADO.NET is that part of the .NET Framework that deals with databases.
With ADO.NET you can issue pretty much any commands that the underlying database understands. So you can use OleDbCommand.ExecuteNonQuery() to issue CREATE TABLE commands. You will need to look up the MS Access reference for details of what SQL you need to perform these actions.
|
|
|
|
|
|
Hi,
I am quite OK with using the System.Drawing class to create an image on the fly, but if I want to save it as a .gif image, how do I create/define/set the colour palette to avoid horrible dithereing if I use anything other than "standard" colours?
Any pointers gratefully appreciated
thanks
Fred
|
|
|
|
|
Web-safe colors are the closest thing to a sure bet. After that, you're on your own.
|
|
|
|
|
hi friends,
i am facing a problem in vs 2005 i am using gridview control and sqldatasource bounded to it
in the update command of the sqldatasource i am passing a query
UPDATE aspnet_UsersInRoles SET RoleId = @RoleId WHERE UserId =@userid
the gridview is having three columns userid,username and roleid among which userid is hidden
if i make this column visible then the above query is working fine but when i make it visible=false then i am getting an
error : Must declare a variable @userid
also i want to know if i place a dropdownlist in gridview how to access its selectedvalues as a parameter
can anybody help me
regards jabbar
jabbarsb
|
|
|
|
|
Hi,
error : Must declare a variable @userid
when column propert visible is false is correct.
Since in visual 2005 if column in visible false then data is not binded to that column.
Sol: To avoid this problem make visible false of column in RowCreated event of grid. This will solve your problem.
hope this helps.
Cheers! Anil
|
|
|
|
|
Does any one know if there is a way to set the order in which HTTPHandlers are called? Or is it determined by the order in which they appear and are rendered on the page?
only two letters away from being an asset
|
|
|
|
|
Hi Mark,
MSDN says about the httpHandlers Element[^]:
"The <httpHandlers> settings are inherited by the application subdirectories.
The <add> directives are processed in top-down, sequential order. If two or more <add> elements specify the same verb/path combination, the final <add> overrides all others."
So, IMHO you can put the handler down on the list if you it to run.
|
|
|
|
|
I probably screwed something up because it didn't seem to process them in the correct order. Thought I might be missing something.
only two letters away from being an asset
|
|
|
|
|
Hi there,
I'm making a website in ASP.net which shows some data from Microsoft SharePoint on it. but an error occured and it says this:
Product registry key not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.SharePoint.Portal.Topology.ProductKeyNullException: Product registry key not found.
Source Error:
[No relevant source lines]
Also this source file: _paj-teg.0.cs in my temporary asp.net files directory
I can't find nothing in internet to resolve this problem, it's a very important project and I can't do anything more
Hope I can get any help here
Hugs
|
|
|
|
|
Aloha,
I'm porting a Wordpress (Linux blog/CMS) based system to ASP.NET. Many of the articles in Wordpress have URLs like www.domain.com/santa-claus.
How do I handle requests to such URLs in ASP.NET. We have ported the data, but our ASP.NET pages have URLs like www.domain.com/article?id=234
I'm considering implementing an IHttpHandler that transforms the requests with the help of a database query (table with Wordpress/ASP.NET matches).
Is that the correct thing to do?
Thank you, Mads
|
|
|
|
|
|
Great, thanks. I'll definately take a look at that one.
Currently my attempt looks like this (no IHttpHandler stuff), it works, but there might be a best practice I don't know about...
<br />
protected void Application_BeginRequest(Object sender, EventArgs e)<br />
{<br />
string requestPath = HttpContext.Current.Request.Path.ToLower(); <br />
if (string.IsNullOrEmpty(requestPath) == false)<br />
{<br />
if (requestPath.Contains(".aspx") == false)<br />
{<br />
int accountItemId = <Database Call><br />
if (accountItemId > 0)<br />
{<br />
string convertedPath = "Article?Id=" + accountItemId.ToString();<br />
HttpContext.Current.RewritePath(convertedPath);<br />
}<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Hello Friends.
I think this is one of the most innovative and challenging tasks I have ever encountered in my career.
I want to incorporate the Link Grammer open source project for the Open Source WordNet Dictionary.
Link Grammer:
http://bobo.link.cs.cmu.edu/link/index.html[^]
Wordnet:
http://wordnet.princeton.edu/[^]
The Link grammer project is available as a C code+ VC++ code + a API in C# as a console application.
Can anybody help me about this.
Thank You.
|
|
|
|
|
I want to export data from a table(sql) to a CSV file, using asp.net.
Thanks in advance,
Suresh Dayma
|
|
|
|
|
|
Thanks for the Reply.
Regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|