|
Use
Convert.FromBase64String()
Thanks & Regards
Pete
SIEMENS Information Systems Ltd
|
|
|
|
|
I know how to do that much; however, my out is to the stream.
How do I resize the image before outputting it to the stream.
see code below
byte[] buffer = Convert.FromBase64String(htmlBase64());
Page.Response.Clear();
Page.Response.AddHeader("Content-Disposition", "attachment;
filename=displayImage.jpg;");
Page.Response.AddHeader("Content-Length", buffer.Length.ToString());
Page.Response.ContentType = "application/octetstream";
Page.Response.BinaryWrite(buffer);
Thank You, Signed... Linda
xxx
|
|
|
|
|
I am developing a site in asp.net 3.5, our appication design is simple – All our application pages communicate with database through a web service – In effect this web service itself is our database layer.
Now in middle of the project, due to some security issues, we dropped the idea of exposing our database layer as a web service.
Though they have dropped this for now, later they have the idea of exposing it as a web service, so that customers can directly communicate with our DB instead of coming through web pages.
So at this point, my suggestion was to pack the whole app_code folder of web service to a .net library(.dll) and reference it locally from the web pages, or
To copy and paste the app_code folder of webservice to the app_code folder of the web application. Since they cannot afford recompiling the data layer for every modification later on, the choice for them was to put it in App_code folder, so that they don’t need to recompile the whole stuff after modifications.
Now here is my problem:
-In future, if they want to make use of same .cs files in this application app_code folder to be exposed as web service, is it possible?
Technically speaking its kinda sharing the app_code folder between 2 application(one is a .net web application and the other one a web service)
I tried to put the whole web service directory(which includes app_code,.asmx files and web.config) inside the app_code of web application, I am able to access those service methods inside my pages.
But it gives a compilation error “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”. If I configure this as a virtual directory in IIS, we cannot access these classes inside the pages. (What I was thinking is of creating a separate virtual directory on the same level of web application and not as a subfolder to it.)
As you know, this error is basically bcoz of the authentication entry in web service web.config file. AS when I googled, I came to know that, a web application can have any number of web.config in its subfolders, but they cannot have <authentication> entries in any other than the root web.config.
Though I can change the allowDefinition attribute for authentication in machine.config file, I don’t want to do that,as its risky!
Is there a way to resolve this?
Contraints are:
- I don’t want to re-compile the code every time I make change or for a minor release
- I don’t want multiple versions of same file to be maintained – so I need to share the .cs files between a webapplication and a web service.
Please let me know your suggestion on this one.
Thanks
Ben
|
|
|
|
|
Try to create a DAL
I Mean a class library project where you maintain all your data access codes.
reffer the assembly in you web application/service. you will be having a single code base.
Thanks & Regards
Pete
SIEMENS Information Systems Ltd
|
|
|
|
|
The problem then is that, everytime we do a release of fixes or minor enhancements, we need to recompile the library. This I need to avoid, where as in app_code, jst dumping the edited file would do the work, as it'l be getting automtically copiled on the first access
|
|
|
|
|
which means, you are deploying the sorce code!!!!!!
not the precompiled one!!!!!!!!!!!!
Is that a good practice?????
Thanks & Regards
Pete
|
|
|
|
|
I know thats the baddest practice, bt still they are pushing me for it, as thats the way they are comfortable. The reason behind is that, in this project proper structured source control is not there behind the scense, although we have svn as the source DB..
I know this is a pretty weird way of thinking from my sid for the same reason, I feel like I cannot achieve sharing in such a way .
|
|
|
|
|
I have a reference to a .js file on a masterpage that my Defaut.aspx is using. I need a value from that javascript file that is being set when the file loads, however I need that value prior to the page load of Default.aspx. My problem is that all the referenced .js files on the Masterpage are called after the Page_Load() event of Default.aspx. Is there a workaround for this ?
Thanks.
|
|
|
|
|
So you're trying to access something that's loaded on the client side, from the server side?
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
Yea, in a way I guess I am. I am basically working with a Javascript based HTML editor on which I have created a custom button, on that button's click event I want the contents of the editor (which is developed purely in javascript) to be transferred in to a .NET string that I can use to continue my logic. So this attempt is in view of one of the solutions I have thought of for that problem.
|
|
|
|
|
Hi, thanks for looking
I have a script manager in my masterpage instead of in each contentpage (The whole site has the same masterpage)
Not all contentpages need a script manager
Does having a script manager in the masterpage instead of in only the contentpages that need it have any performance problems??
Thanks in advance for any feedback
Alexei Rodriguez
|
|
|
|
|
No , I dont thik so. but check the ratio where you need script manager or not. suppose, you have 100 page and you need Script manager in 90 pages and 10 page with out script manager , that should be any problem , but vice versa should not be happend !!!
Thanks !!!
cheers,
Abhijit
Think Sharp | Code Sharp | C Sharp
|
|
|
|
|
We have lot of data getting loaded on first two pages on application
We are planning to store state codes and may be related data
In application cache. Is it a good idea? How it's gonna effect the
Performance? Any other suggestions?
~AHAGeek
modified on Thursday, September 25, 2008 7:38 PM
|
|
|
|
|
whenever you are going to use cache , that mean it is server side and can be accessable by all. suppose you have 5000 records that can be displayed to maximum user, then simply put the data into cache by retreiving from database first time, rathar than calling every time from data base. it should improve your performance.
but while using caching, you have to consider many points like, cache dependecy, Expary etc.
cheers,
Abhijit
Think Sharp | Code Sharp | C Sharp
|
|
|
|
|
Hi, thanks for looking
Im changing my layout from table to css
Im having a little problem with the columns and maincontent
I have a page with header content (divided in 2 areas) and footer
The content divs dont resize to heigth of each other
Ive tryed setting the parent container's height to 100% as well as the body and html, but they dont seem to work
Here is an example of my code, is anyone know how to make it work, please let me know, Thanks in advance:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>100% Height CSS Layout</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
html
{
height: 100%;
}
body
{
min-height: 100%;
height: 100%;
}
#header
{
width:300px;
background-color:Green;
height: 50px;
}
#main
{
width: 300px;
min-height: 100%;
height: 100%;
}
#leftCol
{
float: left;
height: 100%;
width: 100px;
background-color: Gray;
}
#container
{
float: left;
background-color: #DDD;
width: 200px;
height: 100%;
}
#footer
{
width: 300px;
height: 50px;
background-color: Green;
}
</style>
</head>
<body>
<div id="main">
<div id="header">HEADER</div>
<div id="leftCol">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</p>
</div>
<div id="container">
<h1>
100% Height Demo</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque tempor. Nam in
libero vel nisi accumsan euismod. Quisque quis neque. Donec condimentum, enim convallis
vestibulum varius, quam mi accumsan diam, sollicitudin ultricies odio ante vitae
purus. Etiam ultricies quam. Vestibulum turpis turpis, fermentum ut, accumsan quis,
tempor at, ipsum. Nam felis elit, sollicitudin id, ultrices faucibus, fringilla
vel, dui. Aliquam tincidunt iaculis eros. Sed in lorem. Nullam eu enim. Quisque
tristique pretium diam. Fusce tempor sollicitudin ligula. Donec purus eros, mattis
quis, mattis vestibulum, congue quis, felis. Nulla facilisi. Nam ultricies posuere
justo. In feugiat.</p>
<p>
Sed non nibh. Sed sapien ipsum, fringilla condimentum, consectetuer vitae, convallis
eu, urna. Aenean id elit eu nulla aliquet congue. Sed fringilla nonummy nisi. Donec
aliquet. Quisque varius. Vivamus ut nulla. Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Integer lacinia. In leo nulla, molestie ac, dignissim sed, pulvinar
at, odio. Duis sit amet augue.</p>
</div>
<div id="footer">
FOOTER</div>
</div>
</body>
</html>
Alexei Rodriguez
modified on Thursday, September 25, 2008 7:17 PM
|
|
|
|
|
Search google for "css multi column layouts height 100%", and you'll find a bunch of answers. I'm sticking with tables....
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
I implemented Autocomplete textbox in Visual Studio 2005 by implementing webservice as implemented in
http://www.aspdotnetcodes.com/AutoComplete_From_Database.aspx
The xml file is getting generated but I am not getting output in the website. What may be the problem? Do I need to mention something in web.config file so that it can interact with the xml file?
Thanks
|
|
|
|
|
check whethere the div element required to populate the suggestions is in place.
if it is there the check if you have proper stylesheets downloaded
Thanks & Regards
Pete
SIEMENS Information Systems Ltd
|
|
|
|
|
Could you please explain in detail ?
I implemented exactly as in
[^]
Nothing else...
Please help.
|
|
|
|
|
I have a DataGrid, with an ItemTemplate that has an image and label. In the EditItemTemplate the label is replaced by a textbox. My problem is that the edit template only shows when I click the Edit button the second time. What gives?
A human being is part of the whole called by us universe, a part limited in time and space. We experience ourselves, our thoughts and feelings as something separate from the rest. A kind of optical delusion of consciousness. This delusion is a kind of prison for us, restricting us to our personal desires and to affection for a few persons nearest to us. Our task must be to free ourselves from the prison by widening our circle of compassion to embrace all living creatures and the whole of nature in its beauty… The true value of a human being is determined primarily by the measure and the sense in which they have obtained liberation from the self. … We shall require a substantially new manner of thinking if humanity is to survive. (Albert Einstein, 1, 1954)
|
|
|
|
|
Come on Brady, you should know better than this. "What gives" is that you are obviously doing something wrong! There - does that help?
Now try looking carefully at your code.
|
|
|
|
|
I found out, by looking at other people's code, that you need to bind again after setting the EditItemIndex. This works nicely, but zaps you back to the top of the page after editing.
A human being is part of the whole called by us universe, a part limited in time and space. We experience ourselves, our thoughts and feelings as something separate from the rest. A kind of optical delusion of consciousness. This delusion is a kind of prison for us, restricting us to our personal desires and to affection for a few persons nearest to us. Our task must be to free ourselves from the prison by widening our circle of compassion to embrace all living creatures and the whole of nature in its beauty… The true value of a human being is determined primarily by the measure and the sense in which they have obtained liberation from the self. … We shall require a substantially new manner of thinking if humanity is to survive. (Albert Einstein, 1, 1954)
|
|
|
|
|
Brady Kelly wrote: but zaps you back to the top of the page after editing.
Yes, that can be a bit of a pain... but with a bit of javascript* in the itemdatabound event you can insert anchor tags on each row and a line of javascript at the end to jump you down to the right place...
* [edit] I mean, of course, inserting javascript into your page via the ItemDatabound event
|
|
|
|
|
Hi,
I need to enable Profile in my ASP.NET 2.0 web app.
In order to enable it I followed the next steps:
1. manually created the sql profile tables using the aspnet_regsql -A all command
2. enabled authentication from the web.config file
<authentication mode="Forms">
<forms loginurl="~/auth/login.aspx" timeout="60" protection="All">
<authorization>
<allow users="*">
3. configured the profile provider
<connectionstrings>
<add name="devProfileProvider" providername="System.Data.SqlClient" connectionstring="server=myServer;database=aspnetdb;User Id=sa_dev;Password=devPass;Connection Lifetime=3600;Min Pool Size=10;Application name=mySite">
and
<profile enabled="true" defaultprovider="myProfileProvider">
<providers>
<clear>
<add name="myProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionstringname="devProfileProvider" applicationname="mySite">
<properties>
<add name="MyProp" type="String" defaultvalue="Andrei">
4. defined profile properties - see above
From what I've read so far about Profile in ASP.NET that should be enough to start working with the profile in my web app, but currently I am not able to work with it. I don't have access to any of my properties and I don't have access to the Profile object.
Can anyone see any mistake in the steps I've made or should I perform some extra configuration for my application?
What do I need to do in order to work with the profile?
Thanks in advance!
Andrei
|
|
|
|
|
|