|
thanks for ur answer.
[-+]?([0-9]*\.[0-9]+|[0-9]+)
can u modify the above expression as per my requirement?
i want to add like 12.234 or 234.222 like this
kissy
|
|
|
|
|
The person has given you a clue, maybe you should work some of it out on your owm.
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
|
Try validating the control using Javascript and regular expressions.
Hope this helps you.
Regards,
Vengat P
|
|
|
|
|
hi,
i have two websites say xx.com and yy.com hosted on same server. when a user logged in xx.com and then if he opens yy.com he should be automatically logged in or vice versa like orkut and gmail.can anyone provide a reference or way of doing it. thanks in advance.
alok tripathi
|
|
|
|
|
|
thanks for the reference but this example uses Login control of asp net which handles all the authentication. can you please provide me a reference or way so that i can do it my using my own custom login page because i am new to asp.net so i really don't have any idea about how this login control works.
alok tripathi
|
|
|
|
|
Goto The Cookies management.
Create a unique Cookies for both of the site and check this cookie when user logged in the site in each and every time if cookies present into the client machine then no need to redirect the login page if not then you should be redirect the user into login page.
And when user click the logout button then expire the cookies.
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hi,
My i am working on asp.net 2.0
I want to use built in security features.
Actually, i used login control for the login.
And i am using web.sitemap file for filling for tree view.
Using Website Administration tool, i have defined 2 logins and 2 roles.
Roles are Administrator and Users.
I have assisgned 1 role for each user.
I have created 2 folders in my website.
1. Admin
2. User
For Admin folder i have given access to Administrator role
and for User folder i have given access to User as well as Administrator.
And i also denied access to all users for my Admin folder.
In web.config file i added membership tag with the provider and specified securitytrimmingenabled true.
But, when i execute my application,and give login details tree view is not displayed. What i mean to say, is none of the nodes are displayed.
But, if i comment that code in web.config file, My treeview is displayed. But, even the pages inside Admin folder are accessible to Users role also.
Can u please help me in this regard.
Thanks in advance.
|
|
|
|
|
SUDHAKAR PALLAM wrote: But, if i comment that code in web.config file
What code?
SUDHAKAR PALLAM wrote: But, even the pages inside Admin folder are accessible to Users role also
Accesible?? you mean you can really access them or you can see them on the treeview?
If you cant see when you set securitytrimmingenabled = true it must be because you didnt set the permision correctly
permisions for the Admin folder:
Allow roles = "Admin"
deny users = "*"
permisions for you users folder:
allow roles = "Admin,Users"
deny users = "*"
Alexei Rodriguez
|
|
|
|
|
That membership tag which i added is commented.
And regarding the second clarification,
It appeared in the treeview as well as i am able to access it.
But, when i refresh the page, it is going to loginpage.When i give the same login details of Users role, it is not taking me inside the website.
What i mean to say is, it is working properly once i refresh the page.
|
|
|
|
|
It seems weird
How did you set the permission (web.config)??
Alexei Rodriguez
|
|
|
|
|
Hi,
I have a wizard control set to 5 different steps. I placed a formview control on 3rd step's container of the wizard. However I am not able to assign any values to controls in the formview in back-end because they do not show up in intellisense.
The question is: How could I populate a dropdown box in formview1 in back-end? The dropdown boxes bind to a objectdatasource but must be populated with coding in beckend.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Use:
Dim ddl as dropdownlist = formviewName.findcontrol("dropdownName")
if ddl is nothing then exit sub
ddl.datasource = datasource
ddl.databind
Alexei Rodriguez
modified on Monday, October 6, 2008 12:43 AM
|
|
|
|
|
Thanks for responding.
Your sample requires a datasource. However my aim is to ad items in dropdownbox one by one in back-end. Now I decided to move everything out of formview control and now facing another difficulty to bind the dropdownboxes with objectdatasource. All I want is to pass each single dropdownboxes' selected values to objectdatasource when I click the insert button. The button should initiate the following procedure.
<br />
Private Sub ObjectDataSource1_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles ObjectDataSource1.Inserting<br />
<br />
Dim ParamsFromPage As IDictionary = e.InputParameters<br />
Dim NewObj As New property_availability(0, 0, 0, 0, "")<br />
<br />
NewObj.Getyear = Int32.Parse(ParamsFromPage("GetYear")).ToString<br />
NewObj.GetMonth = Int32.Parse(ParamsFromPage("GetMonth")).ToString<br />
NewObj.GetDayFrom = Int32.Parse(ParamsFromPage("GetDayFrom")).ToString<br />
NewObj.GetDayTo = Int32.Parse(ParamsFromPage("GetDayTo")).ToString<br />
NewObj.GetStatus = ParamsFromPage("GetStatus").ToString<br />
<br />
ParamsFromPage.Clear()<br />
<br />
ParamsFromPage.Add("GetYear", NewObj.Getyear)<br />
ParamsFromPage.Add("GetMonth", NewObj.GetMonth)<br />
ParamsFromPage.Add("GetDayFrom", NewObj.GetDayFrom)<br />
ParamsFromPage.Add("GetDayTo", NewObj.GetDayTo)<br />
ParamsFromPage.Add("GetStatus", NewObj.GetStatus)<br />
<br />
End Sub<br />
<br />
Do you have an idea how to do that?
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Sorry about my sample, i had the wrong datatype, i corrected it
If you are not setting the datasource and would like to add items manually, you can do it, just use the ddl.items.add
I havent used the object datasource, but what happens if you set the inputparameters?
e.inputparameters("ParamName") = dropdownlist.selectedvalue
What is all your code supposed to do??
It just reads thevalues and adds them again, am i missing something?
Alexei Rodriguez
|
|
|
|
|
Hi Alex,
Thanks for the sample. You can set input parameters in olny ObjectDataSource inserting event. However my scenerio is little bit different.
ObjectData Source is bind to Gridview and Gridview was getting populated by the formview. However I decided not to use Formview anymore because when you place a fromview inside a wizard, you won't able to get the controls' properties which are inside the formview. That is why now I am looking for a solution to somehow bind each single dropdownboxes to objectdata source, I can do that too but when you bind a dropdownbox to an objectdatasource you can't populate it in back-end coding somehow.
Anyway, I will try to integrate your sample and see if it is going to work out.
Thanks bunches for your help, I really appreciate it.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
JUNEYT wrote: However I decided not to use Formview anymore because when you place a fromview inside a wizard, you won't able to get the controls' properties which are inside the formview.
You can get the properties of the controls inside the formview
Dim ddl as dropdownlist = formviewName.findcontrol("dropdownName")
if ddl is nothing then exit sub
'you can set the datasource or any property end also add items to the dropdownlist
ddl.datasource = datasource
ddl.databind
Alexei Rodriguez
|
|
|
|
|
Thanks Alex but if I do it with the way you have indicated, I won't be able to control the events of these dropdownboxes which must be defined in aspx page.
For example, let say that I have a dropdownbox inside the formview and I want to control its OnChangeCommand="Mybox.SelectedIndexChanged".
An error occurs when you do that because it rejects not to use such definition for the dropdownbox. This problem turned in to a disaster for me.
Thanks for your help. I really much appreacited.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
JUNEYT wrote: but if I do it with the way you have indicated, I won't be able to control the events of these dropdownboxes which must be defined in aspx page
Yes you can access any event of the server control no metter if it is in the page, or inside a formview, or inside a formview which is inside another formview, it doesnt matter
To add an event to a dropdownlist, it is like with any other control
To add the default event of the control, just double click it, for the dropdownlist, the defult event is the selectedindexchanged
If you need another event, select it in the design view, in the properties window (F4) select the button that shows the events instead of the properties, select the event you want and double click it, this will generate the event in the code behind, then program your stuff as you normally would
Let me know if you are able to do it or if you have any doubts
Alexei Rodriguez
|
|
|
|
|
salam aghaye vaziri
http://www.IrExpert.ir?22439
|
|
|
|
|
The correct answers are A and C.
Why is C the correct answer and not D?
Shouldnt i set enablePasswordRetrieval = true to let the user retrieve the password?
Thanks for any comments
================================
You create a Web Form. The Web Form allows users to recover their passwords. You add a
PasswordRecovery server control by using the following code
segment.<asp:PasswordRecovery runat="server"/>You need to ensure that the server
control generates a new password and sends it by e-mail to the users e-mail address.
Which two actions should you perform? (Each correct answer presents part of the solution.
Choose two.)
A. Create a valid <smtp> definition in the Web.config file.
B. Set the passwordFormat attribute of the configured membership provider to Encrypted.
C. Ensure that the enablePasswordRetrieval attribute of the configured membership provider is
set to False.
D. Ensure that the enablePasswordRetrieval attribute of the configured membership provider is
set to True.
Answer: A, C
Alexei Rodriguez
|
|
|
|
|
Because the question states that you need to generate and send a NEW password for the user, NOT allow them to retrieve their current one.
|
|
|
|
|
I would like to make a HttpHandler that looks for querystring and edits the image (let's say jpg) as specified. I can do all this and it works great. My issue is since every JPG is being sent to the handler what do I do if I want it to not do anything? I tried to Server.Transfer to the requested image when the querystring is 0 but that basically makes a loop. I figure I can have the handler read the file image then save it to the output stream with no edits but I don't want the server doing the extra work for nothing. Is there and easy way to do this? Is to a lot of extra work for the server to read and dispose rather than just hand the file over? Is there a better way to write the Web.config (currently I have <add verb="*" path="*.jpg" type="HTTPHandlers.PicHandler> )? Am I going about this all wrong? Thanks for any help given.
I am using ASP.NET 2.0 with VB.NET code behind.
<div class="ForumMod">modified on Sunday, October 5, 2008 12:19 PM</div>
|
|
|
|
|
well, *something* has to handle the request - if not your custom handler then .NET itself, so as long as you pass it straight back if no editing is required I wouldn't worry too much...
If [condition] Then
' amend image
...Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
Else
' send original image straight to browser
context.Response.ContentType = "image/jpeg"
context.Response.WriteFile([FilePath])
End If
Otherwise, if you can separate your images into different folders such that all those that need amending are all in a particular folder then you can re-write the path="*.jpg" attribute in your web.config accordingly...
|
|
|
|