|
you hjave to check condition for your application and based on that just show your controls.
e.g
protected void Page_Load(.....)<br />
{<br />
if(Condition of Application1)<br />
{<br />
} <br />
else if(Condition of Application2)<br />
{<br />
} <br />
.<br />
. <br />
} you can also Switch statement for that
|
|
|
|
|
Another way is to create different user controls for different applications types
And load one og these user controls at run time depending on our business logic
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi,
I'm new to web development and asp.net and can't figure this one out.
I've manually created a datatable in my dataset.xsd page and now I want to bind a gridview to that datatable. I need to do this so I can design the gridview at design time and manipulate it at runtime. I will be populating the datatable at runtime as well.
I can't see how to create a suitable datasource to link to the table?
Can someone point me in the right direction please. Obviously I'm coming from a forms background.
Thanks.
Glen Harvy
|
|
|
|
|
Hi,
using a Gridview "id" to bind the data. For example,
GridviewID.DataSource = ObjectDataTable;
GridviewID.DataBind();
|
|
|
|
|
So, I have an ashx called image upload. Inside I have code like this:
<br />
if ( context.Session[Base.SessionKeys.CurrentRequest] != null && context.Session[Base.SessionKeys.CaseId] != null)<br />
{<br />
if (int.TryParse(context.Session[Base.SessionKeys.CurrentRequest].ToString(), out currentRequest) && int.TryParse(context.Session[Base.SessionKeys.CaseId].ToString(), out caseID))<br />
{<br />
bool success = ImageUpload.UploadImage(context.Request.Files[key], currentRequest);<br />
This all works in IE, and the first line fails in FF, and in the debugger, I see that context.Session is empty. I've looked through the context object and can find no data in it whatsoever. Is there a trick here, or does this just not work in FF ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Can i know the version of IE and firefox you are using?
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Well, it's being tested across multiple version, but I have IE7 and the latest firefox, here.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hello,
I am looking for a way to programatically edit the web.config file for the section below. Most importantly I will need to set the website login password to a certain value stored in the database. The password keeps changing in database whereas username remains the same. Can you please suggest a way this can be done using C# 2.0?
<authentication mode="Forms">
<forms loginurl="Login.aspx" timeout="60" protection="All">
<credentials passwordformat="Clear">
<user name="testuser" password="test123" />
</credentials>
</forms>
</authentication>
Thanks!
|
|
|
|
|
Just Check this Example
using System.Web.Configuration <br />
AuthenticationSection section =<br />
(AuthenticationSection) WebConfigurationManager.GetSection("system.web/authentication"); <br />
Label1.Text = section.Mode.ToString();
now you can able to solve your problem. for every settings of web.config there is a class on given name space. Asp.net Web Administration Tool Also used same API.
if you have any doubts ask me !!!
|
|
|
|
|
hi,
I am using the following code on Page_Load event of login page:
// Get the section.
AuthenticationSection section =
(AuthenticationSection)WebConfigurationManager.GetSection("system.web/authentication");
// Get the users collection.
FormsAuthenticationUserCollection formsAuthUserColl = section.Forms.Credentials.Users;
this.lblMsg.Text = formsAuthUserColl[0].Password;
formsAuthUserColl[0].Password. = "testuser";
The step that assigns current password to a label text works fine, however when I try to assign a password "testuser", the page fails at run-time with error "Exception Details: System.Configuration.ConfigurationErrorsException: The configuration is read only". I looked up Visual Studio 2005 documentation. It says Password property can be get or set. I have no clue why it errs out with read-only. Please advise.
Thanks.
|
|
|
|
|
Can some one tell me how to do this. Say I have created a Test website which has a default.aspx page. I have another folder called admin in the same root directory. Inside this folder i have a web page PostMessage.aspx which has a form with a Message text box and a dropdown box called visible which has only 2 values true or false. When the user clicks the Submit button I want the message in the text box to be displayed based on the visibility set on the drop down box to true or false. I actually want the message to be displayed in the default.aspx page which is in the same folder level like the Admin folder. How can I do this. I dont want to use a database for the time being.This is really urgent. Any sample code or tutorial will be great help. Thanks
Ex:
Test Website
Default.aspx
Admin Folder
PostMessage.aspx
modified on Wednesday, August 20, 2008 4:30 PM
|
|
|
|
|
1. The place where you save files here is not important.
2. You need to implement passing values between web pages.[^]
3. If you don't need to save message values in database which you write then you can leave option of database.
4. http://www.google.com
5. http://www.codeproject.com
Regards
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hello
I use from a compress C# code in HttpCompression.cs and i use from two methods in sercice.cs
one for before compress
other for after compress
DO I do it true?
also i added HttpCompression.dll to web.config
<httpmodules>
<add name="HttpCompression">
type="Behrouz.Compression.HttpCompression, HttpCompression"/>
C# code for compress:
its file is HttpCompression.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.Services.Protocols;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.VisualBasic;
using System.IO;
using System.IO.Compression;
using Microsoft.CSharp;
/// <summary>
/// Summary description for HttpCompression
/// </summary>
namespace Behrouz.Compression
{
public class HttpCompression : IHttpModule
{
//public HttpCompression()
// {
//
// TODO: Add constructor logic here
//
// }
void IHttpModule.Dispose()
{
}
void IHttpModule.Init(System.Web.HttpApplication context)
{
context.BeginRequest += this.onZip;
}
public void onZip(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
string encodings = app.Request.Headers.Get("Accept-Encoding");
if (encodings == null)
return;
Stream baseStream = app.Response.Filter;
encodings = encodings.ToLower();
if ((encodings.Contains("gzip")))
{
app.Response.Filter = new GZipStream(baseStream, CompressionMode.Compress);
app.Response.AddHeader("Content-Encoding", "gzip");
}
else if (encodings.Contains("deflate"))
{
app.Response.Filter = new DeflateStream(baseStream, CompressionMode.Compress);
app.Response.AddHeader("Content-Encoding", "deflate");
}
}
}
}
C# code in server side:
its file is service.cs
sing System;
using System.Web;
using System.Web.Services;
using System.Data;
using System.IO.Compression;
using System.Data.SqlClient;
using System.Web.Services.Protocols;
using Behrouz.Compression;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Diagnostics.DebuggerStepThroughAttribute(), System.ComponentModel.DesignerCategoryAttribute("code"), System.Web.Services.WebServiceBindingAttribute(Name = "Service1Soap", Namespace = "http://tempuri.org/")]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/getproducts", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string HelloWorldAfterCompress() {
return "Hello World";
}
[WebMethod]
public string HelloWorldbeforeCompress()
{
return "Hello World";
}
}
|
|
|
|
|
aref87 wrote: DO I do it true?
I don't know, does it seem to work ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hello
i do not underestant your question
what is your SCOPE?
|
|
|
|
|
Gosh - are you serious ? You posted a bunch of code and said 'is this right'. No-one is going to trawl through your code with such a vague question. Why do you ask ? Is it working as expected ? What is your specific concern ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hello
I want to use compressing of message for my weservice.
I want a dataset that it is full of orders table of Northwind,then i want send it to client compressin.
I tried with 2 ways
the first way is in this address:[it is vb.net and i converted to C#]
http://www.dotnetjunkies.com/PrintContent.aspx?type=tutorial&id=46630AE2-1C79-4D5F-827E-6C2857FF1D23
the second way is in this address:
http://www.barnamenevis.org/forum/showthread.php?t=55129&page=1
that the second address is codes that you saw in my post in codeproject.
i tried very much for getting a true answer about compressing,but non of the above could guid
me to a true result.
it seems that i have lost true way for getting a good result , and i want anyone help me.
|
|
|
|
|
Hello
Is there one who help me?
with thanks
|
|
|
|
|
Hello
when i use from using ICSharpCode.SharpZipLib or
using ICSharpCode.SharpZipLib.zip
and then when i want to produce dll file ,i go to following path:
D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
and i produce dll file from this code:
csc /t:library /r:System.dll,System.Web.dll D:\inetpub\wwwroot\myApp\App_Code\HttpCompression.cs
but i get this error:
there is not ICSharpCode.SharpZipLib.zip
But i add ICSharpCode.SharpZipLib.dll to my project and put it to bin folder.
|
|
|
|
|
Hi,
This is a rather obscure question but:
I was wondering if there was a way that when a user clicks a button to take data(either in a single or multiple datagrids, or arraylist etc,doesnt matter) and store it in a xls with multiple worksheets and then email it as an attachement? All automatically without using Response.ContentType = "application/ms-excel" or Response.ContentType = "application/vnd.ms-excel" or any other technique that will open up excel on the clients machine? Currently I use my sqlserver 2000 database(xp_smtp_sendmail stored procedure) to send the email.
So far my only idea is to use the server side technique of having excel installed on my web server. Create a template of the file I want on the server and having it fill in the relevant data each time it needs to be sent. Then send the absolute path as a parameter to my database that will then email it as an attachment.
My only other idea would be to use the client to create the xls file and then instead of having it open on the client, have it be sent to the server and then emailed?
Sorry if this is confusing, I will be happy to elaborate,
thanks,
Drew.
|
|
|
|
|
NM, I think i got this working using a 3rd party dll to save locally to xls and then used SmtpMail.Send.
Thanks for reading,
Drew.
|
|
|
|
|
gamerdrew wrote: Sorry if this is confusing
A bit, what I don't understand is why you want to send a mail with the file.
If you don't want it opened on the client you can use Response.AppendHeader
Response.ContentType = "application/ms-excel"
Response.AppendHeader("Content-Disposition","attachment; filename=testfile.xls")
Response.TransmitFile( Server.MapPath("~/temp/testfile.xls"))
|
|
|
|
|
Hi
I was wondering how i can upload pictures with the fck editor?
best regards
Örvar
|
|
|
|
|
shadow17 wrote: I was wondering how i can upload pictures with the fck editor?
You have fallen victim to a navigation error, the FCKeditor forums are over here[^]
led mike
|
|
|
|
|
Hi,
Can anyone tell me why "Japanese currency symbol is displaying a single strikethrough on “Y” (i.e. “¥”) instead of double strikethrough (i.e. “¥”)." I am useing Asp.net and C#.
Thanks in advance
|
|
|
|