|
The way I do this stuff, and the best way, is to have a http handler, which will not return the file ( whose actual path is hidden ), unless the link came from my site also.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Yeah, I failed miserably doing that.
Gotta do some more reading on HTTPHandlers, it would seem.
var question = (_2b || !(_2b));
|
|
|
|
|
Using http handler is a much simpler as Abhishek Sur said.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
And also place the file in a directory which cant be found from the Virtual path, means dont place it inside a virtual directory.
Just get the file through the handler from an unknown location, (say C:\private)
That will do the trick ..
|
|
|
|
|
True
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
after rendering aspx page the html shows in browser and if we see the source of the page then user can see raw html. if there is anyway as a result i can encrypt html content after rendering it to browser but browser can read and show the result.if i can encrypt then user can not understan what is written in my html due to security reason. if it is possible then please let me know in detail.
tbhattacharjee
|
|
|
|
|
I think it is not possible to encrypt your HTML.. as otherwise your browser will not render it correctly. Rather what you can do, is just strip spaces and new lines from the html so that everything will be rendered in a single line.
Do it in your custom handler. Also use GZip/Deflate compression to shrink the response.
s = Regex.Replace(s, "^\\s*",string.Empty, RegexOptions.Compiled | RegexOptions.Multiline);
s = Regex.Replace(s, "\\r\\n", string.Empty, RegexOptions.Compiled | RegexOptions.Multiline);
s = Regex.Replace(s, "<!--*.*?-->", string.Empty, RegexOptions.Compiled | RegexOptions.Multiline);
Just use regEx replace to do your job easy in your custom StreamFilter.
Hope you understand.
|
|
|
|
|
Hi all,
I want to put this java script ["window.open('Organization.aspx','mywindow','width=750,height=600')"; ]
in treeview event TreeView1_SelectedNodeChanged1
so that on click of every node or sub node this window would open..
help me out please thanx
never let you down...always be happy..
|
|
|
|
|
try this
if (!IsPostBack)
{
TreeNode Parentnode = new TreeNode("Home");
TreeNode node = new TreeNode("Organization","","","'Organization.aspx","_blank");
Parentnode.ChildNodes.Add(node);
TreeView1.Nodes.Add(Parentnode);
}
|
|
|
|
|
not working properly... for my tree view.
its only working for node "HOME" 's sun nod Organizatin.aspx
i want it like i click ANY node or sub node then this popup windows appear.
any way thanx a lot.
never let you down...always be happy..
|
|
|
|
|
Hi gaurav
Try this
if (!IsPostBack)
{
TreeView1.Attributes.Add("onclick", "javascript:window.open('Organization.aspx.aspx','mywindow','width=750,height=600');");
}
himanshu
|
|
|
|
|
I want it in a way like if i click ANY node or sub node then this window wud appear.
through your code even i click joints of nodes then this window is appearing..
Thank You
never let you down...always be happy..
|
|
|
|
|
Hi,
May be this solve your problem
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open( 'http://www.google.com','mywindow','width=750,height=600' );", true);
}
himanshu
|
|
|
|
|
protected void TreeView1_SelectedNodeChanged1(object sender, EventArgs e)
{
Response.Write("<script>window.open('group.aspx?id=" + TreeView1.SelectedValue + "','mywindow','width=200,height=200')</script>");
}
This is the answer..
its working fine...!!
thanx a lot.
never let you down...always be happy..
|
|
|
|
|
<br />
TreeView1_SelectedNodeChanged1="NodeChg();"<br />
<br />
<javascript><br />
function NodeChg()<br />
{<br />
window.open('Organization.aspx','mywindow','width=750,height=600')";<br />
}<br />
</javascript>
-------------------------------------
看上面代码.
living none stoping.
|
|
|
|
|
I have see the following strategy adopted.
==> Associate the body of the page with an ID ( Associate a list item (li ID="One")with an ID
==> Associate ul with a body (ul ID="Nav")
the three ids can be combined together in the CSS file to set background of
selected menu item.
Question: But what will I do if the menu is in the master page and page is a content page.
Content Pages do not have 'body' tag?
|
|
|
|
|
It shouldn't make a difference to your CSS as when the page is rendered to the browser it will include the body tag from within your master page so as long as your body tag in the master page has the correct id ("Content" in the example above) you should be alright.
|
|
|
|
|
Hi,
But won't master page always have the same id?
even if a different page is selected, master page's body will continue to have the same id!
Is there a method to change the id?
Thanks,
NetQuestions
|
|
|
|
|
Hi All ,
I have one grid grid view where i display search content. in this grid view i have one hyperlink field Which is used to navigate to other page
My problem is can i redirect to more than one page using DataNavigateUrlFormatString ="UpdateAppointment.aspx" based on condition.
Thanks all in advance
Amit Patel
|
|
|
|
|
yes you can
use the if statements like
if (Session["Loginname"] == null)
{
}
else
{
}
Hope it Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Brothers,
I'm using Microsoft Visual Web Developer 2008 with ASP.Net to develop website. When I run the website, it does not display at the center of screen (always in left). How to set it to center of the screen.
Thanks,
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
It is always important to google before you post
http://www.discussweb.com/asp-asp-net-programming/4800-how-can-i-set-div-position-screen-center-all-resulotions.html[^]
OR
and again do mean the Contents of the page itself ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
"If I found some on net, I wouldn't post!"
What contents do you mean?
I just wanna ask if there's any way to set the page run on the center screen.
When I use table and set its alignment to center, it actually displays in the middle of the screen.
I drag and drop the textbox or label to table, but it doesn't point on the table (display at the left side) when I run it. I have read that link, but it seems it doesn't help me out.
Thanks very much again,
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
I am working with asp.net using c# the webapplication running on localserver when i want to run webapplication in remote machine the following error shown
Cannot show a file dialog unless the application is running in UserInteractive mode
Cannot show a file dialog unless the application is running in UserInteractive mode.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Cannot show a file dialog unless the application is running in UserInteractive mode.
Source Error:
Line 166: string FileName, FilePath;
Line 167: int j = ListBox1.Items.Count;
Line 168: OFD.ShowDialog();
Line 169:
Line 170: FileName = OFD.SafeFileName;
Source File: e:\siva\kumar\aspmerger\Default.aspx.cs Line: 168
Stack Trace:
[InvalidOperationException: Cannot show a file dialog unless the application is running in UserInteractive mode.]
Microsoft.Win32.CommonDialog.ShowDialog() +4031259
_Default.AddFile() in e:\siva\kumar\aspmerger\Default.aspx.cs:168
_Default.AddTextFile() in e:\siva\kumar\aspmerger\Default.aspx.cs:88
_Default.Add_Click(Object sender, EventArgs e) in e:\siva\kumar\aspmerger\Default.aspx.cs:205
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
|
|
|
|
|
The error means what it says. And what it means is that you have zero idea about ASP.NET. If you knew anything at all, you'd know that server code runs on the server, and client code, on the client. Therefore, your code, if the framework let it run, would cause a message box to show on the server, thus freezing the server, and the client would see nothing, the website would time out.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|