|
Hi guys. Im doing a project at the moment that requires the user to select what categories they want to be registered for via check boxes. BUT there arent set categories(and no set number), so they must be read from the database, and then the controls must be generated.
So what I have done is put a place holder and then just create new controls in the while read loop of the database. Two problems though:
1) How do I name these(incrementally?)? I cant say
CheckBox chkBx + "i" = new CheckBox();
2) Even if I could incrememnt their names how would I see what they had checked once they click ok?
I thought about
lblStuff.Text += "<asp:checkbox id="\"check"" i="" runat="server" xmlns:asp="#unknown" />" (ignore the xmlns :-/ )
But that still leaves the second problem.
Am I going about this the wrong way?
Thanks guys
|
|
|
|
|
you can use CheckBoxList instead of creating Checkbox Dynamically..
and for CheckBoxList you can Bind the values form Database..
and onclick of OK, you can loop through CheckBoxList.Items.Count to check which is Selected and You can take only Selected Values..
|
|
|
|
|
Perfect
Thanks, really appreciate it!
|
|
|
|
|
Actually the idea is as follows...Suppose a new message to a particular client is updated in the database...now the server should post this message to the client without the client request (like the messages shown in Instant messaging etc). I think instant messaging and all the related stuff use the 'Poll' method to fetch data. My question is that can it be done without Polling ?
I mean like if there is no update then no communication should be there between server and client but if there is some message to be posted to the client then the server should itself send it without client request...
Please let me know if there is a way to do it...
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
modified on Thursday, February 19, 2009 1:48 AM
|
|
|
|
|
hi,
how to update a grid view using button field?I am using sqldatasource.
regards,
bill
|
|
|
|
|
write down the select query in click event of button and
bind the data dynamic in gridview.
eg.
com.commandtext="select * from tablename";
adp = new SqlDataAdapter(cmd);
adp.Fill(ds);
gridview1.datasource=ds;
gridview1.databind();
it will bind the data from database dynamically,
Regards,
Keyur Satyadev
|
|
|
|
|
<asp:gridview id="grid" runat="server" autogeneratecolumns="False" datakeynames="adminid" xmlns:asp="#unknown">
DataSourceID="sqldatasource1" Width="100%" >
<columns> <asp:boundfield datafield="adminid" headertext="S. No." sortexpression="adminid">
<asp:boundfield datafield="name" headertext="Admin Name" sortexpression="name">
<asp:boundfield datafield="doj" headertext="D.O.J." dataformatstring="{0:dd/MM/yyyy}" sortexpression="doj">
<asp:templatefield headertext="Login Name" sortexpression="username">
<itemtemplate>
<%#Eval("username")%>
<asp:templatefield headertext="Password">
<itemtemplate>
<asp:label runat="server" id="lbl_pswd" text="<%#Eval(" password")%>"="">
<asp:templatefield headertext="Action">
<itemtemplate>
<pagerstyle horizontalalign="Right">
<headerstyle cssclass="cartheader" height="20px">
<asp:sqldatasource runat="server" id="sqldatasource1" selectcommand="select * from table" updatecommand="set in sqldatasource update panel" xmlns:asp="#unknown">
ConnectionString="<%$ ConnectionStrings:ConnectionString %>">
|
|
|
|
|
hi all,
how to create my own widget for my web site. Also tat widget have to be embed in other site....
plz send me any example sites
Ashok
|
|
|
|
|
Hi
I am using currency converter web service in my web application.When I tried it on local server it is working absolutely fine. As I upload it on US server it gives error.
System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) at System.Net.HttpRequestCreator.Create(Uri Uri) at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) at System.Net.WebRequest.Create(Uri requestUri) at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at CurrencyConvertor.CurrencyConvertor.ConversionRate(Currency FromCurrency, Currency ToCurrency) at CurrencyExchange.get_rate_USD(String fromCurr) at pricing_between.currencyAmt(String str_curr) The action that failed was: Demand The type of the first permission that failed was: System.Net.WebPermission The Zone of the assembly that failed was: MyComputer
Any body have any idea please solve it
Thanx
Seema
modified on Thursday, February 19, 2009 3:07 AM
|
|
|
|
|
Hi,
I am trying to implement usertoken authentication for my webservice using WSE.
My client and webservices already have soapextension incorporated at either ends.
The problem is my SOAPOutputFilter is not getting called at the client and the call is not going to the server itself.
I get the following error message
"The input was not a valid SOAP message."
The code works fine with SOAPExtension alone and WSE alone.
But combining these two gives the above error.
Can anyone please help me with this.
Thanks,
R.Sundar
|
|
|
|
|
i am geting value from datbase with this code CONVERT(varchar(11), TH_DT_HolidayDate) AS Expr1 and output is jan 15 2009 . but i want output like jan 15,2009 .how can i do this .thnx in advance.
|
|
|
|
|
The way you're doing this, it's a SQL question. Return a date time instead and use the ToString method to return the date formatted as you'd like.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
CONVERT(varchar(11), TH_DT_HolidayDate , 18)
may be 18 not sure , u can change this digit from 10 to 19 and then check them
|
|
|
|
|
|
Am trying to create a tutorial app from asp.net site which demos the Movie database utilizing MVC in asp.net. When I create my project and database, I right click on the Controllers folder (Created automatically by the project when making new project) I should see a "Add Controller" menu item. It does not show up on my pc, but does show up on another system, also using vs2008. Any ideas on what I need to do to remedy this problem?
Dale
|
|
|
|
|
Hi, i have a problem with vs(visual studio) 2008 creating subprojects.
I want to have a main web application and under it i want to have sub web applications.
The sub web applications must not have web.config file.
They must use the main application's web.config.
I could do this with vs 2005 but not with vs 2008
When i start to debug one of sub applications, it tries to creat a web.config file
Does anyone have an idea about what am i doing wrong?
|
|
|
|
|
Create one project, then add subfolders. Of course, you need to load your main folder and all of your projects, just to work on one. Surely that was the same in VS2005 ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi,
i m developing an email application for a private domain. The composing email part has completed but how to do the inbox related work? what kind of code is needed to retrieve email from server to user's account.
regards-
Sandip
|
|
|
|
|
|
Hi,
I've created a web service and to test it, I've created an ASP.NET page within the same solution.
When I run it in debug, I can browse to my page and submit some information to the web service. I can then follow the call into the web service in debug but I get an error due probably to the credentials - I'm using Sharepoint in my web service.
At that point, I think I need to set some credentials on the web service like this:
MyWebService.Service myWebService = new MyWebService.Service();
myWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
The trouble is, that there's no Credentials property on the web service for some reason. It's odd because when I create a separate test harness and reference the web service, the Credentials property is available.
Can anyone help? I think I'm missing something fundamental here
|
|
|
|
|
errror generate when the data reader read.i have made the login project,
the error write that
(Incorrect syntax near the keyword 'user')
. but there is not a problem in table name because i have change it to users than it will give different error
the error occurred in loReader = loCommand.ExecuteReader()
Imports System
Imports System.Data.Sql
Imports System.Data
Imports System.Data.SqlClient
Partial Public Class _Default
Inherits System.Web.UI.Page
Public Shared lsConnectionString As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim loConnection = New SqlConnection(lsConnectionString)
Dim loCommand As New SqlCommand("SELECT * FROM user", loConnection)
Dim lsUsername, lsPassword, lsUserType, lsstatus, lscount As String
Dim loReader As SqlDataReader
'Dim abc As IDataReader
loConnection.Open()
error here loReader = loCommand.ExecuteReader()
'abc = loCommand.ExecuteReader()
loReader = loCommand.ExecuteReader
While loReader.Read()
lsUsername = CStr(loReader("username"))
lsPassword = CStr((loReader("password")))
lsUserType = CStr((loReader("usertype")))
End While
loConnection.Close()
End Sub
End Class
|
|
|
|
|
User is an SQL keyword. Either you have mispelt your table name or you are in the wrong direction.
|
|
|
|
|
Hi, what u can do is replace
SELECT * FROM user with
SELECT * FROM [user]
then it will get recognized as a table name...
living life on the flip side
|
|
|
|
|
In the current project I am working on, I have an image control that displays an image from a remote url what the user inputs into the site's database. Since these are remote url's, if the remote site pulls that image down I want to display my no-photo.jpg to indicate to the user on my site that they will need to find another photo to use. I've been looking at the members of the Image control class and I can't seem to find anything there that can help me. Does anybody know what I can do with this issue?
|
|
|
|
|
I want to bind <asp:checkbox xmlns:asp="#unknown"> control in <asp:listbox> control dynamically. means the listitem will bind from database table and with each listitem there should be a checkbox. Please let me give some idea how i can do this?
|
|
|
|