|
I need a code that should browse the file folders(functionality like FileUpload control)and select the file from the dialogue box
|
|
|
|
|
Hi
i have 3 web pages in my website as first one login.aspx, second one home.aspx third one info.aspx, if i enter into the site the default page is login.aspx, after login.aspx, home.aspx will come and after home,aspx info.aspx will come. This is the normal flow of execution. . But i want a URL like, with that URL if i enter the site, i should able to open the page info.aspx directly and before opening the page info.aspx it should check my login credentials using login.aspx. Can you suggest any ideas for this and if possible give me full length code in asp.net using c#.
|
|
|
|
|
Have a look at http://aspnet.4guysfromrolla.com/articles/020205-1.aspx
it gives you a nice url/parameter manager.
You could specify in the inital url which page you want to go in after login.
for example: localhost:1885/DevelopmentWebsite/login.aspx?redirect=info
when you authenticate the user you can check the redirect param and make your redirection based on that value.
|
|
|
|
|
HI All,
I want to make an animation extender visible from code side just like calling a modelpopupextender.show(); from code. Is it possible please help !!!!!!!!
|
|
|
|
|
Dear All
I'have webform containing asp server controls like labels, html tables, datagrid & image control etc. This form is beasically displaying entire records of any 1 selected employee id.
But my problem is i require this details for any user input no. of emloyee id's. So that I can take a print of all those selected employees.
Pls Help Me
I'll be grateful to u all if u have some idea how to do it in VB.Net Framework 1.0
Its really urgent
Sameer
|
|
|
|
|
I'm not sure what you're asking, but I think you want to show a list of items, not just one. Use a datagrid for this. And abandon ASP.NET 1.0 as soon as you can.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Can any tell me the the difference between asp.net file upload control and html file upload control..?
is there any filesize & file type limitation for both of these? or can we upload any file of any size?
Thanks
|
|
|
|
|
I guess you don't know what ASP.NET is and does. ASP.NET creates HTML. A HTML upload control is the ONLY way for any file upload to work, it's all a browser supports, without a java plugin or similar.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
About the filesize limitations i find these useful
http://msdn.microsoft.com/en-us/library/aa478971.aspx
|
|
|
|
|
Folks,
How can I add functions to a JavaScript type generated by using the
GenerateScriptType in a web service.
Basicly, the C# class has data members that are serialized and passed to the
client to be deserialized javascript objects whoose type bears the same name as
the c# type.
Of course, methods can not be shared.
So let's say I have a c# type
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace AddJavascriptMethodTest
{
[Serializable]
public class CDog
{
public CDog()
{
this._sColor = "Brown";
}
public CDog(string sColor)
{
this._sColor = sColor;
}
private string _sColor = null;
public string Color { get { return _sColor; } }
}
}
Then I create a web service to return an object of CDog. I also add a GenerateScriptType attribute to generate a javascript type called AddJavascriptMethodTest.CDog
using System.Web.Services;
using System.Web.Script.Services;
namespace AddJavascriptMethodTest
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class wsAnimals : System.Web.Services.WebService
{
[WebMethod]
[GenerateScriptType(typeof(CDog))]
public CDog GetDog()
{
return new CDog("Red");
}
}
}
Now, the default.aspx looks like this (and this version works fine)...
<!--<!-- BEGIN FILE: Default.aspx
<!--<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AddJavascriptMethodTest._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Add Javascript Method Test</title>
<script language="javascript" type="text/javascript">
function getADogFromTheServer()
{
AddJavascriptMethodTest.wsAnimals.GetDog(GetDog_Callback_Success, GetDog_Callback_Failure);
}
function GetDog_Callback_Success(oDog)
{
alert(oDog.Color);
}
function GetDog_Callback_Failure(oDog)
{
alert("GetDog_Callback_Failure");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/wsAnimals.asmx" />
</Services>
</asp:ScriptManager>
<div>
<input type="button" value="Get a Dog" onclick="getADogFromTheServer();" />
</div>
</form>
</body>
</html>
So, okay, you click the button, and the word "Red" is displayed in an alert.
Now, what I want to do instead is add a prototype function called
RenderForDisplay() to the Javascript type AddJavascriptMethodTest.CDog.
CDog.RenderForDisplay() would look somethig like this. It would probably be in a
seperate js file.
AddJavascriptMethodTest.CDog.prototype = {
RenderForDisplay: function()
{
return "I was given a " + this.Color + " Dog.";
}
}
So I can replace GetDog_Callback_Failure(oDog) in the Default.aspx with
function GetDog_Callback_Success(oDog)
{
alert(oDog.RenderForDisplay());
}
The AddJavascriptMethodTest.CDog type is generated by the wsAnimals.asmx file at
runtime (maybe at compile time, but I don't think so).
Perhaps I could add the RenderForDisplay() function in pageLoad, but that does
not seem the right way to go.
Any Ideas?
Brett Nieland
|
|
|
|
|
I am trying to use a dropdownlist with a textbox and a "search" button to search a table in sql 05 and display the results in textboxes. This is in c# and asp.net2.0. Any help would be greatly appreciated, thanks in advance
-KB-
|
|
|
|
|
brownk1297 wrote: I am trying
Do you mean you wrote actual code for this trivial task, or that you had the idea and hoped someone here would code it for you ? Where are you stuck ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am wanting to write code for this trivial task...i dont want anyone to write the code for me i wold just like a lil assistance in how to have a dropdownlist referencing 3 columns in a sql table and then by the column they choose type in the search criteria in the txtbox and click the button to search. So in the dropdownlist if they choose "Name" and in the textbox they type the name they want to search. I am new at asp.net and c# so i am not sure how to go about this...
|
|
|
|
|
brownk1297 wrote: I am new at asp.net and c# so i am not sure how to go about this...
OK - perhaps you should learn some ASP.NET first ? Why do people always seem to be saying 'I am new to programming, and I want to know how to do this complex task' ??
If you have three items in a drop box, then your two options are:
1 - string mash your SQL using the column name
2 - write three bits of SQL ( perhaps stored procs ) and call the right SQL based on which item was selected.
you should read up on SQL injection attacks if you're writing something that will get any real world use, and if you're building SQL in code. But, I assume no-one will ever use this, if you're new to ASP.NET and C#, you're surely not yet writing code people will use, right ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: should learn some ASP.NET first ?
I agree. The OP should find a good book on ASP.NET. Not a shortage of them out there.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Currently, I have something like this:
<asp:DataGrid>
<asp:TemplateColumn>
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
</asp:TemplateColumn>
</asp:DataGrid>
I was wondering if there was a way (either behind the scenes in C#) or in the markup itself, to make it so that we don't have to duplicate the markup. There was a thread I found for the FormView control, where we could set FormView.EditItemTemplate = FormView.ItemTemplate, but unfortunately, this is not available for the DataGrid TemplateColumn type.
|
|
|
|
|
Greetings,
I think the thread you read already gave you the correct way ... its only a matter of casting the template column correctly then set the EditItemTemplate property to ItemTemplate property ... here is the code:
TemplateField colmun = this.GridView1.Columns[0] as TemplateField;
colmun.EditItemTemplate = colmun.ItemTemplate;
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Ah, I didn't think of that. Thanks.
|
|
|
|
|
Hi i am trying to upload a file to a folder in FTP...
i am using asp.net file upload control .. how can i do this ?
Santhapur
|
|
|
|
|
Search google for: upload files +ASP.NET
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Thanks for your answer..
i have done it prior to posting..
i founded two links donno which one works ?
http://www.codeguru.com/csharp/csharp/cs_internet/desktopapplications/article.php/c13163__2/
http://www.developerfusion.com/code/4340/ftp-client-library-for-c/
Santhapur
|
|
|
|
|
I can understand that you just want to brows for files and upload the file you select to the server
If this is the situation
All you need is the upload control as you did
Then create a file on the sever and copy the data as stream of bytes from client's file to server's file
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Hi,
I created a webcontrol (Textbox derivated) and I have a property that was suppose to link a Label control to it - when my control gets the focus, I'm gonna change some style from the assigned label.
Here is my code... When I select the Label, my text box disappears and show an error "Error Rendering Control ... Cannot create an object from its string representation"... How can I fix it?
public virtual Label Label
{
get
{
object label = ViewState["Label"];
if (label == null)
return null;
return (Label)Page.FindControl((string)label);
}
set
{
ViewState["Label"] = value.UniqueID;
}
}
Thanks,
Dirso
|
|
|
|
|
It would be nice when someone marks my question as a "Bad Question" tell me why. It might be the solution to my problem and I would vote for him as a big 5.
Thanks,
Dirso
|
|
|
|