Currently on my website when a user logs in if their role in their row within the Users table is equal to 0 it will give the user 3 options on options.aspx, however if not it will take them to home.aspx
Now I am trying to just do this on one whole page, so if the user was to be directed to the options page, instead it would take them to the home page where the user would have to click an option amongst the 3, if the user has already selected an option then it would load a different content placeholder.
Is a content placeholder what I need to achieve my idea? If so, wouldn't it be abit too easy to get out of the situation since the client could inspect element and edit the visibility on their side?
When you set the Visible="false" property on a server-side control (runat="server") the tag is NOT rendered to the browser. As a result, the client cannot set it as visible. So for example:
<asp:PlaceHolder runat="server" Visible="false">SomeText</asp:PlaceHolder>
The SomeText will be nowhere to be found in the HTML if the user does View Source. If, however, you do a CSS style on a control such as style="display:none" then your concern is 100% valid as the user could just show this.
This same logic hold true for any ASP.NET server-side control. If you set Visible="false" it's never sent to the browser.
Related
Am working on Ektron 9.I have created an ektron html form with n number of fields.
Suppose i have a radio button list(Choice Field) following a text field.My choice radio button list has
two values Yes and No and the end user select one of those values.
I need to make the following text field required if the user select Yes in the choice radio button list.If selected No no need to make the text field required.
Is there any way to achieve the same by ektron custom validation?i have tried that but when am checking the fields the choice field not listing in the the insert field part of validation tab.
Is anything wrong with me ,if not anyone suggest a solution for this?
Custom validation like you describe is not possible with standard Ektron HTML forms. Your best bet would be to create an ASPX web form to achieve what you need.
There is the possibility of creating the HTML form, displaying it on an ASPX page and then adding your own custom javascript. However this is error prone as the HTML form and JS are very closely tied together. You are better off using an ASPX web form, and not an Ektron HTML form for this.
Hello Everyone I am a newbie in asp.net,
I have a checkbox inside a repeater which is inside an update panel,the page flickers whenever I click the checkbox, finally found that adding the ClientIDMode="AutoID" controls the flicker and everything works fine.
I am wondering about ClientIDMode what this has to do with the flicker,
went through msdn and found it generate the value of the ClientID property.
First distict the asp.net controls, from the final rendered html controls.
When you make asp.net controls you give them an ID, with this id you can address them and make change on them on code behind and with programming in general.
For example with this code
<asp:CheckBox id="check1" Text="option a" runat="server" />
you can use the check1 to get their value, change the text, and many others.
Now, asp.net must render this check box on the html page. When you make any control on an html page you must set to him a unique ID and name, and heres come the automatic id assignment.
asp.net take care to avoid conficts between final rendered controls and make automatic ids base on the structure that you have use on asp.net side.
For example, if this control is inside a custom control, and this control is inside a master page, asp.net will add also this names on the final id, to avoid conflicts.
Conflicts can exist for example on a repeated control, where you render the same control many times, so there you need to change each rendered id.
Conflicts can exist when you use many times the same user control.
Conflicts can exist when you use the same id on different user controls on the same page.
All that and many others asp.net comes and solve with the automatic generated id on client side render.
Yes, it does have something to do with the flicker.
See this related question for another example of the fact that Repeaters don't handle client ids well, causing exactly this problem because they end up doing a full postback instead of a partial postback.
Setting ClientIDMode="AutoID" is the workaround and allows the Repeater to succeed in doing the partial postack it is supposed to be doing from within the UpdatePanel.
Because of this Repeater bug, without ClientIDMode="AutoID" you were experiencing a full postback and full page load. A full page load does cause a flicker compared to a partial page load.
When using the login control what would be the best way to get 1 or 2 more buttons to the left of the login button?
To make it short i want the default control as it is, but with another button in the control called "anonymous".
I have already made a custom web user control and made it display succesfully.
Ive tried working with layout template, but without much succes so far.
LayoutTemplate does not contain an IEditableTextControl with ID UserName for the username
Also the login control does no longer display in the design mode for some reason.
Best Regards.
You should convert the classic Login control to Template. There is a small triangle in the right corner where you can choose this option
Convert to Template
After that you can add whatever you like in the table, but you should be careful not to change or remove the controls which are already in the table.
I have a user control with this OutputCache:
<%# OutputCache Duration="86400" VaryByControl="LnkBtnTopVanzari" %>
Where VaryByControl is the id of a link button i use to switch the active view of a multiView contained in an updatePanel.
The problem is that when i press that link button, the page does a full post back and the view is not switched.
If i remove the outputCache directive, all works great (pressing the link button the correct view is shown via ajax).
Do you know where i am wrong?
Thanks.
The VaryByControl parameter is used to vary depending on the value of the control which you specify. As the value of the link button will always be the same, the cache is not varied.
I believe this is intended to be used for controls such as dropdown lists, where it is feasible for the output to be different based on the selected value in the list.
You may want to try using VaryByParam and changing your link button to a hyperlink, specifying the view as a query parameter, or trying out VaryByCustom. Otherwise possibly you could possibly split the content of your views into separate user controls which are themselves output cached, leaving the multiview and your link button outside any caching.
I have a varying number of links that I need to add to a webpage using C#. A little background may help so, the ultimate goal of this is to have the user select an area of a map and choose the data they would like to get from this map. After the data reports have been generated, a link pops up for each area selected that is a download link for the report.
I can add new links fine, but I'd like to keep things centered on the page like the main control, but when I add a new hyperlink it keeps adding it to the left side. I have my page style set to centered and I don't see the option in a hyperlink object to set it's position. Is there any other way I can do this?
Forgive me but it's my first C# web app.
Thanks!
Make yourself a
<asp:PlaceHolder runat="server" id="plhFoo" />
In the location that you want to add your dynamic stuff to, and then add your controls to this, instead of the page.
-- Edit
If you want to position it, you may put a
<asp:Panel runat="server" ID="pnlFoo" CssClass="someclass" />
And style someclass; because the panel will render as a div.