|
Hi guys,
I'm curious to know if any one has used the web client software factory? I'm still in the dark as to why it is being used? To me it sounds like that are trying to separate the code behind from the ASPX page, but isn't that already taken care of when you create a separate .cs file for every page created?
Please can someone share some light on this topic and is this the way to go for the future, or is there something else to look at?
I also read that they say it must be used for large website, what do they mean by large? I have a e-commerce web site with a lot of products, there is a couple of pages as well.
Brendan
|
|
|
|
|
I can view a pdf document in html like:
<iframe src="C:\file.pdf" width="100%" height="750"></iframe>
but when I put the same come to be dynamically written on a literal control on a button click
like:
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
litShow.Text = "<iframe src="C:\\file.pdf" width="100%" height="750"></iframe>";<br />
}
the pdf file is not displayed
plz help
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
Did you check to see what IS rendered ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
yes
I do get the html code on 'view source'
but the file is not displayed
I tried with many files...
Same result
here is the html source
<br />
<br />
<input type="submit" name="Button1" value="view" id="Button1" /><br />
<input id="pdffile" name="pdf" type="file" /><br /><br />
<iframe src="C:\310001.pdf" width="100%" height="750"></iframe><br />
<br />
<div></div>
_____________________________________________________
Yea! I could be wrong...
modified on Sunday, January 18, 2009 8:32 AM
|
|
|
|
|
Oh, I see.
saud_a_k wrote: C:\310001.pdf
This will only work if your server and client are the same machine, in other words, it will never work in the real world.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
saud_a_k wrote: src="C:\\file.pdf"
You cannot quote a path like above.
You should use path like
http://<website>/folder/a.pdf
If you still want to use the directory path then it should be like
src="file:///C|/file.pdf"
|
|
|
|
|
The server and client are the same machine
I also used:
string myfile = AppDomain.CurrentDomain.BaseDirectory+"\\310001.pdf";<br />
litShow.Text = "<iframe src="+myfile+" width="100%" height="750"></iframe>";
the file is in my bin folder, but I still cant see the file
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
saud_a_k wrote: string myfile = AppDomain.CurrentDomain.BaseDirectory+"\\310001.pdf";
This will return path as
C:\<folder name(s)>\
saud_a_k wrote: the file is in my bin folder, but I still cant see the file
You need to write is as:
AppDomain.CurrentDomain.BaseDirectory + "Bin\\310001.pdf"
|
|
|
|
|
Thanx but it still does NOT show.
I even tried making a html file with the iframe code and tried opening it in the main inframe
it still does not show!
Please try this.... I think its wierd
create a simple html file that displays a pdf file in an iframe
<iframe src="C:\pdffile.pdf" width="100%" height="750"></iframe>
include the file as a part of the project on VS (i use 2005)
now right click in the solution explorer and >> view in browser
does it show?
it doesn't for me.
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
hi;
I want to create dll of all files are in APPCODE folder.I am using asp.net 2.0 frame work.
Thanks
|
|
|
|
|
snehasish wrote: I want to create dll of all files are in APPCODE folder.I am using asp.net 2.0 frame work.
snehasish, You can !!
But first of all tell me why ? If you think about code security , you do not need to worry about that , when you Publish the code from Visual Studio You App_Code folder and codebehind files are compiled into one assembly.
Now back to your solution .
Step 1 : Create A Class Library
Step 2: Copy the APP_Code Folder on that Class Library.
Step 3: Build the Application
Step 4: Delete App_Code From your web sites
Step 5: Add that Dll as a Reference to your web sites
Step 6: Access your classes and methods from that dll
|
|
|
|
|
Abhijit Jana wrote: But first of all tell me why ?
Maybe he wants to reuse the code there in other projects.
|
|
|
|
|
Abhijit Jana wrote: If you think about code security , you do not need to worry about that
Sorry, I don't understand where the benefit of having the code in AppCode is beneficial in the area of code security. Could you explain?
|
|
|
|
|
Colin Angus Mackay wrote: Abhijit Jana wrote:
If you think about code security , you do not need to worry about that
Sorry, I don't understand where the benefit of having the code in AppCode is beneficial in the area of code security. Could you explain?
Sure sir, Generally we put class files on App_Code folder . We can able to access them all over the application . Here all codes are placed as simple class file. So some people think that Its very unsafe to keep code in app_code folder as its placed as plain text format. But if we published the code from Visual Studio all the Class inside the App_code and Codebehind are converted to assembly.
But I prefer to create Class Library
|
|
|
|
|
I still don't see where the security is. Compiling into an assembly isn't adding security as Red-Gate's reflector can just reverse it out again. All that is doing is converting it into the format that the CLR needs in order to run.
|
|
|
|
|
Colin Angus Mackay wrote: ompiling into an assembly isn't adding security as Red-Gate's reflector can just reverse it out again.
Exactly Agree . But from that question I was thought may be he is asking for that his code represent as plain text.
|
|
|
|
|
hi;
Sorry for the delayed response.your suggestions was extremely helpful.Actually i got(in APP_CODE) some code in C#.net.But my project is running on vb.net.so i was trying to covert it by some online conversion tool.But it provided error in my application.So i tried to convert it into dll.Now it works.Thanks again.
|
|
|
|
|
hi,
I have to display the password column of the database in the grid view.But the text mode should be password.How can I do this?
Ragards,
Bill
|
|
|
|
|
I don't know why you are using it. But You can do it using Template Filed in GridView. Add TextBox as a Template Field and Set TextMode="Password"
<asp:GridView ID="GridView1" runat="server">
<EmptyDataTemplate>
<asp:TextBox ID="TextBox1" runat="server" TextMode="Password" ></asp:TextBox>
</EmptyDataTemplate>
</asp:GridView>
cheers,
Abhijit
CodeProject MVP
My Recent Article : Exploring Session in ASP.Net
|
|
|
|
|
when i used that the column was not visible.
|
|
|
|
|
billcodes wrote: when i used that the column was not visible.
Read This [^] article.
|
|
|
|
|
U must store the password in the database in the encrypted fashion for the security reason.
And when u want to retrive,retrive as it is
|
|
|
|
|
<body onunload="CallMyEnd()">
<script type="text/javascript" language="javascript">
function CallMyEnd()
{
// call server side method
alert(PageMethods.GetName());
}
</script>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"/>
-------------------------
and my methods CS.
[WebMethod]
public static string GetName()
{
return "1111111";
}
the explorer return alert undefined
what is the error in this code ?
i try the script on head and now in body the same error ?
ahmed eldeghedy
|
|
|
|
|
The method call is asynchronous. You need to specify a callback function in the call:
PageMethods.GetName(callback);
In the callback function you get the result:
function callback(result, context, method) {
alert(result);
}
You can also specify another callback function for a failed AJAX call. The method parameter in the callback is the name of the server function called, so you can use the same callback for several page methods.
(I never used AJAX page methods before, so I learned something new this day too. )
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
In my web form, I am creating some controls like button, textbox, dropdownlist etc. dynamically. How to create events for those controls like button click or textbox change etc? Any idea on this or it would be great if anybody can provide any useful link on this.
Thanks
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|