|
To reiterate advice I've given you many times before
1 - use real variable names, not listbox1
2 - don't grab text from a control to create SQL, it can be used for injection attacks
3 - don't iterate over a collection looking for the item that is selected, when the listbox has a selecteditem property
I despair that we are discussing the same function, week after week, but you don't actually take the advice given to you.
ASPnoob wrote: Response.ContentType = "" & CurrentModels.SelectedItem.Text & ""
Why are you grabbing the mime type from the CurrentModels control, and where does the buffer variable come from ? What does this have to do wtih ListBox2, anything ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am facing one typical problem, that is I have to just create update panels dynamically have server side controls in their content template, which is done through clicking the button which is in another
update panel whose update mode is set to conditional, this is bcoz when the user click to add controls and fill them with values and then again click to generate more controls , the previously generated controls loses its values, so i put the button that generate controls dynamically in another update panel and set its update mode to conditional, now when i click on to add controls nothin happens , but when i took button to outside panel it adds but page postback , i want to add controls using partial postback and when i click add button it will not cause the previously dynamically generated controls to lost their values.
|
|
|
|
|
Hello All
I have a custom web control i am finishing, and have run into an issue that has caused problems for me in the past.
That problem being that when said button is clicked, the page state (ViewState) is only changed after the second click.
These are programmatically created buttons.
This appears to be some weird postback issue, but I am about out of ideas here.
Last time I ran into this, I simply forced a full-page reload, and that was enough. As this is part of a control, that hack is not an option.
Can someone please enlighten me as to how a control as "simple" as a button can "just" do what it is supposed to on the FIRST click?
--stoland
-- modified at 17:28 Monday 30th July, 2007
|
|
|
|
|
Usually this means that your code is setting the viewstate at the wrong point in the page lifecycle. The order is page_load, events, page_prerender. Set some breakpoints and walk through your code to see the sequence of events, and you'll work out where your bug is. The button, I guarentee you, is working fine.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I was wondering if its possible to set the visibility element of an HTML table, using the aspx.vb file. I know you cant set the ID and call it like that. Just wondering if there is any good way to do this (preferably without JS). What i'm doing is setting certain tables to be visible based on who logs in.
Thanks,
Nate Lindley
|
|
|
|
|
yes, it is easy to achieve but what you have to do is to built the table (add rows and colums) dynamically at runtime in the table...
e.g in code-behind file (default.vb) use
if condition=true then
//add code to create table with 3 rows and 5 colums
elseif condition2 =true then
// add code to create table with 2 rows and 2 colums
elseif condition3 = true then
and so on......hope it helps
Note: at Design time you should just place the Table control on the place where it needs to drawn at runtime... then handle, height, width, and etc attributes programtically in code behind file
:- Rashid Ali -:
|
|
|
|
|
Hey Rashad,
Yea I could do that to create a data table, but I just want an HTML table. Basically the situation is that I'm going to have a page with 5 tables on it (one on top of the other). Each table has multiple rows (one for each PDF for that state), and I want to set the Visibility attribute (style) of each one.
Thanks,
Nate
|
|
|
|
|
i think u can achieve the same task using Server Table Control, why you want to use html table only?
:- Rashid Ali -:
|
|
|
|
|
Thanks for the quick responses rashad! Basically these tables are just one column tables with multiple rows that contain links to PDF files. I know I could just use one table and set the links for that table, but I'd rather have 5 separate tables and have their Visibility properties changed based on the login.
Thanks,
Nate
|
|
|
|
|
Of course.
objHTMLTbl.Visible = false
I didn't get any requirements for the signature
|
|
|
|
|
Hey Todd,
Thanks for the answer. But, it is an HTML table, thus not having a Visible attribute (has visibility) and as far as I know you cant set the attributes of an HTML table by using the ID (that would def be the easiest way tho).
Thanks,
Nate Lindley
|
|
|
|
|
In one of .aspx page of my application HTML Compnent is used. I need to get object of one of HTML control mentioned in HTML Component. But there is no public method or property declared in HTML Component which is returning any of HTML Control. We are also not allowed to modify code in HTML Component.
So, in this scenario how can we get the object of HTML control mentioned in HTML Component?
Thanks,
Satindra
Myself Satindra working on .NET Technology for last four years.
|
|
|
|
|
Does the HTML Component have a FindControl Method?
I didn't get any requirements for the signature
|
|
|
|
|
No such method is there. Actually there is no method or property in HTML componenet which returns object of any HTML control mentioned in HTML Component.
|
|
|
|
|
I developed a web application, which has two sections
Client Section: that is visible to local users
Control Panel: allows admin of the site to control the contents of the web application.
I created a cpanel folder on the root of the web application, and all the pages and functionality of Control Panel section goes there. The sample structure of the files is as in below section:
/Default.aspx 'Client Side File
/contactUs.aspx 'Client Side File
/Aboutus.aspx 'Client Side File
/Web.config 'Main Configuration file ( admin section uses connectionstring from
'the same web.config file
/AppCode/DAL/Classes.vb ' Contains all the classes used in both client and cpanel section
/CPanel/Default.aspx ' Admin side File
/Cpanel/UpdateContactus.aspx ' Admin Side File
/Cpanel/UpdateAboutus.aspx ' Admin Side File
Now problem is that, i need to Secure Pages in CPANEL by adding Authenticating process, now if i add the authentication information in
/Web.Config /Main configuration file
then it will apply on both client side and Cpanel side as well... but i need this authentication only in CPanel side, so what i did is add a new configuration file with appropriate instructions and a Login Page, where person trying to open CPanel will be redirected if he/she has not logged in using proper username and password.
here i added those files at place
/CPanel/Web.Config
/CPanel/Login.aspx
but when i try to open any page, it gives me an error message
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS
---- The code for Web.config -----
<configuration>
<appsettings>
<connectionstrings>
<system.web>
<authentication mode="Forms ">
<forms loginurl="Login.aspx" name="realestate" path="/" protection="All" timeout="30">
<credentials>
<user name="myuser" password="abc">
Any Solution?
1- Can we merge two different projects with different web.config files with each others?
:- Rashid Ali -:
|
|
|
|
|
If someone fills in first name on page1.aspx and i want that to appear on page2.aspx, how do i do that? lets say the element name for both of them is fname.
Thanks in advance
|
|
|
|
|
Well, you could do a cross page postback:
Page.PreviousPage.FindControl("txtName");
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Cross page postback is one way, storing information in the session is another, passing it on the URL is another ( this is not safe ), another is to pass an Id on the URL and use it to get the information out of hte database, if it's previously been stored there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dear all;
of course all of us use
Response.redirect("url");
or
Server.Transfer("url");
to open page from another page
how can i close page from another page ?
and is there a way to open and close the page in the same time to get the session or any thing else in this page.
Kareem Elhosseny
|
|
|
|
|
I'm not entirely sure what you're asking about... But I think you might be able to find a solution through javascript. You can use the function window.open() to open a page (typically used for a popup.) If you do that, on the newly opened page you can refference the page that opened it, via window.opener. So window.opener.close() would close the page that opened the current open, provided the current one was opened via window.open().
I hope that helps answer the question?
|
|
|
|
|
my dear;
thx for your attention and your precious time
i want to close the page not lookup window
we can open the page with Respone.redirect()command from another page
i want when i open this page take from it some sessions and close it in the same time because i didnt want the user see it while i take my requirment
plz help me i know it can be rough but plz help me .
Kareem Elhosseny
|
|
|
|
|
Check out the following for some javascript tutorials. You should be able to find what you are looking for.
http://www.echoecho.com/jswindows.htm
I didn't get any requirements for the signature
|
|
|
|
|
I'm sorry to report that you are hopelessly lost. For several days now you've asked questions that indicate that you think that webforms are like winforms. I recommend you buy a book on ASP.NET and read it really fast, before your boss/client realises just how far you are out of your depth.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dear;
of course i didn't have your experience and i still junior right now but i imagine something maybe thats right
i want to make something like back in any browser if it available plz till me
if not can i open the page and close it while i take from it something like in windows
and if u have books in asp can u send it to me
thx for your time
Kareem Elhosseny
|
|
|
|
|
Please, please could somebody tell a real Newbie to .NET and ASP.NET how to create an ASP.NET page using VB with a page of thumbnails which if clicked on brings up the PDF page in full screen size.
Ultimately I will be obtaining the PDF documents from a database (Oracle BLOBs).
If anyone can assist with any part of this, even just how to bring up a simple PDF, I would be deeply grateful as I have to come up with an urgent solution.
Will I need special components? If so what do I need?
Please give detailed instructions (nothing is too obvious) - or ideally a sample app.
Thanks so much
|
|
|
|