|
well,
thank you for the tip
i think i will just keep looking into it
The Mage
|
|
|
|
|
My ASP.NET page generates some HTML, then sticks it into a hiddenfield so a javascript can access it and write it to a popup window.
I had to disable validation for this page, as HTML inside a field triggers ASP.NET's cross-site scripting security.
Now, this was all working well and good until I changed my navigation menus from plain images and anchors to ASP:imagebuttons. The navi menu is on my masterpage and in now within the same block as the contentplaceholder. This is the only change I've done.
Now, when I click a button to go to a different page, all of my pages trigger the ASP.NET cross-site scripting security because of the hiddenfield on a single page.
Now, to try and fix this, I've set the hiddenfield's viewstate to false. I hope this would stop it from posting back, to no avail. Also, I've added the following event:
protected void reportField_Unload(object sender, EventArgs e)<br />
{<br />
reportField.Value = "";<br />
}
But still, the security is tripped. It seems like this hiddenfield is living way outside it it's scope... why?
-- modified at 16:05 Wednesday 10th October, 2007
Edit:
It seems the hiddenfield isn't living too long, it's just that its life is long enough to reach the other page's request validation.
So, it occurs to me that I can disable request validation with
<% Page ValidateRequest="false"%>
and then call Request.ValidateRequest() in the page's OnLoad event. The hiddenfield should be expired by then, and we still get input validation early enough for security, yes?
|
|
|
|
|
I have these pages:
1) DefaultMaster.Master/cs
2) MyPage.aspx/cs
3) BasePage.cs
MyPage.aspx is set to use the DefaultMaster masterpage. MyPage.cs inherits BasePage class (which is derived from the Page class).
How can I access methods and properties of the BasePage class from the DefaultMaster.Master.cs codebehind? I cannot find the right syntax to do it. Please help...
|
|
|
|
|
I assume the master page has a property that gives you the page, you then need to cast that to the BasePage type, preferably using the 'as' keyword and checking first that the cast succeeded.
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 )
|
|
|
|
|
Hi,
I have a gridview and file upload control. When the user attaches a file then I need to add that file name to gridview. In grdiview i have 2 columns one for title and date added. Title is title of the file and date is Datetime.Now
How to add that information as a row to Gridview when they upload the file.
Thanks
|
|
|
|
|
The idea i can give you is that when you uplaod ur file save the name of file in the database and after that bind the table with gridview.
Hope it will work for you.
Sucess needs one Master Stroke
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
ya i also agree with Aavesh..
suchitamanandhar@hotmail.com
|
|
|
|
|
Mahimam wrote: How to add that information as a row to Gridview when they upload the file.
According to me it would be better if you can store the filenames in an ArrayList, after the file is finished uploading, and then bind this arraylist to the GridView. Simple isn't it?
|
|
|
|
|
Is there a way to make dynamic compilation on the web server faster?
On my computer when I rebuild the website the CPU usage jumps to 100% and it's finished compiling in a few seconds. On the server the CPU usage stays around 5% and it takes about a minute to compile.
|
|
|
|
|
hi,
i have got a datagrid. i want to allow the user to click anywhere in a datagrid row anywhere. on postback i want to retreive a column value of that selected row and then proceed further. how can i go ahead in asp.net 2005
Sandeep Kumbhar
|
|
|
|
|
No inbuilt functionality is available. Datagrid will be rendered as HTML tables. So you need to override postback functionality to make it happen
|
|
|
|
|
hi,
thanks for ur valuable reply.
if we use the same thing in gridview it happens. like in gridview in rowdatabound we define e.row.attributes["onclick"]....., on clicking the row anywhere it calls the selectindexchanged event. But in datagrid this is not happening. in datagrid itemdatabound i am defining e.item.attributes..
i am not getting which method to override.
|
|
|
|
|
I'm pretty new to working with ASP.net on Visual Studio 2k5. Is there any reason why when you move more than a couple of controls on the web form at a time, it takes a long time for them to actually move. The development environment seems to be slower/more clunky when it comes to manipulating web forms as opposed to normal forms. Also, is their any way to enable snap lines in the web form designer? And why does everything that is dropped onto the form automatically jump to the top left corner?
|
|
|
|
|
This is bcoz u dont know the actual usage of the page in asp.net purpose.
there r 2 pages in asp.net
1. aspx
2.ascx
so actual controls r placed in ascx page and entire ascx page is draged to the aspx page.
why u hav 2 do all this is understood if u do a project.
Hope this will clear ur question.
mallika
|
|
|
|
|
I am creating a class that inherits from the GridView control and addes a bit of functionality. One bit of functionality that I want to add is the ability to select from a drop down list the unique values on each column header to filter, similiar to the functionality you get in excel with its filters. So if you have the column header for "Department" when you mouse over it, it shows a drop down list of the unique values for the department column and lets you select one, that would then filter the displayed records to just the ones containing that department.
Right now I am dynamically adding DropDown extenders to the header label on the OnRowDataBound() event. To make the list of unique values I was processing the values of the data row by row also in the OnRowDataBound() event. Everything works great until you turn on paging. Then the list of unique values only contains the values that are displayed on that particular page, whereas I want to be able to have the unique values from the entire data table that the grid is bound to. I understand why I only get the data for each page (because I am using e.Row.DataItem from the RowDataBound() event, which only fires for the displayed records). What I think I need is access to the gridview's full datatable to select the results out of it that I want. How can I do that? Or is there a better way to approach this?
Thanks,
|
|
|
|
|
To answer my own question. I am using the GetData function that returns a DataSourceView, and then running an async select statement on it. If there is a better way to do this please let me know. For the moment this appears to work
void DataSourceViewSelectCallback(IEnumerable e)<br />
{<br />
bool isUnique;<br />
data = new ArrayList[Columns.Count];<br />
for (int i = 0; i < data.Length; i++)<br />
{<br />
data[i] = new ArrayList();<br />
}<br />
<br />
foreach (DataRowView drv in e)<br />
{<br />
for (int i = 0; i < data.Length; i++)<br />
{<br />
isUnique = true;<br />
foreach (object o in data[i])<br />
{<br />
if (object.Equals(o, drv.Row[i]))<br />
{<br />
isUnique = false;<br />
break;<br />
}<br />
}<br />
if (isUnique) data[i].Add(drv.Row[i]);<br />
}<br />
}<br />
}<br />
<br />
protected override void OnDataBound(EventArgs e)<br />
{<br />
DataSourceView dsv = GetData();<br />
DataSourceSelectArguments args = new DataSourceSelectArguments();<br />
dsv.Select(args, new DataSourceViewSelectCallback(DataSourceViewSelectCallback));<br />
....<br />
}<br />
<br />
|
|
|
|
|
i want to run a DTS package from inside a procedure like this
ALTER PROCEDURE [dbo].[usp_ImportData] AS
begin
DECLARE @DTSRUNCommand as varchar(255)
SET @DTSRUNCommand =
'DTSRUN /N ' +
'DumpPRMasterToRadhika /E /S ' +
'@@MyServer'
EXEC master..xp_cmdshell @DTSRUNCommand
end
its giving me the error
sql server does not exist or access is denied
please tell me which access rights i require to run it..
i am the system admin on sql-server.
|
|
|
|
|
|
sir i am running it under the administrator account.
i logged in to sql-server analyzer through windows authentication.
That means i m running it under administrator account.
Administartor are already under the sysadmin role.
Still the same error....
Please i am little bit confused.
help me out
|
|
|
|
|
|
Hi,
I'm trying to run a flash intrudction on the login screen.
The flash should run for a few seconds then disappear and the login control should apprear. This should happen on the same page.
Does anyone have an idea how to implement it, or maybe direct me to a good source of info about it?
Thanks in advnace,
Snir.
|
|
|
|
|
Sounds like you need to auto refresh your page. There are a couple ways to do it. You can use javascript. Or you can put in a meta tag.
The meta tag looks like this:
Where n is seconds before refresh
and url is the url to refresh to. You can leave the url blank and it will just refresh the page. I am in process of writing an article about this.
Hope that helps.
Ben
|
|
|
|
|
Hi Ben,
Thank you for the answer.
I've figured it out:
The flash file (FLA file) need to have a naviageToUrl command in its last row that's directed to your login page.
When publishing the FLA file using a common a flash editor (for example adobe flash CS3 pro) it creates an html page that runs the flash file and when it ends it navigates it to the login page.
That's it. So simple. So little documentation on the web about it.
Hopefully a lot of preplexed folks would read this post.
Snir.
|
|
|
|
|
Arggh - flash intros on web pages. Do you have any idea how this really annoys users? It's generally considered to be one of the worst things you can do on a site. Think about it - users want to get into a web site and start using it as quickly as possible. Metrics suggest that customers will navigate away of content isn't displayed in less than 5 seconds - losing you customers and making your competitors happy. Just because you can use Flash doesn't mean that you should.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How Can I disable Refresh button In IE using Javascript?
remember Not F5 ,it's refresh Button??
|
|
|
|