|
I want to generate UserID from the Website when ever new user want to create account that time user have to provide userID its own choice.
that time userid is to check with sql database if the same userID is already exists then Website Give The choice of 3 Or 4 AutoGenerated UserId which is available.
or which is not provided yet.
so it is available...
i want to Autogenerate that userID which is made by user's other information like Fristname,Lastname,Bithdate etc....
|
|
|
|
|
The SQL check is obviously trivial, the main thing is to come up with algorithms such as grabbing the first letter of the first name, appending the surname, and then adding numbers if necessary to create a possible username. The string class has a substring method you can use for this, or you can use myStringt[0] to get just one character ( the first, in this case ).
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i m bigginer in asp.net,
i made website with login control,
suppose I want logout from current page i will click on button logout and them time i securly logout but after logout i click on Internet Explorer Browser's BACK Button that time my page go to on last visited page and it show already login page,
But i really want to do at that time my login page is show request to user to do login for visiting website.
please help me in this situation ,....
as i told above I m bigginer of asp.net and I make login control as my own way means manually.
and i already try to session close and
FormsAuthentication.SignOut()<br />
Session("uid") = 0
but its not working..
|
|
|
|
|
If you are looking at an old page and then when you try to interact with it, it logs out, then you're looking at a cached page. You can mark your pages not to cache. If you can still interact with the page, then you need to add code to stop that happening. I typically write a base class for all my pages that checks the Session("uid") value and redirects to my login page if it tells me the user is not logged in
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
I have cribbed an HttpHandler class to protect certain files on my website, very much along the lines of this article[^]...
(in fact extended to include Word docs, Zip files etc, but the essential code is the same.)
All works fine but for one thing:
If a logged-in user clicks a link to, say, a Word doc, it will open in a new window, and they can then use "File/Save As.." to download it onto their computer. That's fine. But if they right-click the link and choose "Save target as.." and try to save it like that, they will get an "Access denied" message (or "no.jpg" in the example code I linked to.)
What do I need to alter in the code to allow this, without compromising the rest of it?
Presumably, right-clicking means that context.Request.ServerVariables["HTTP_REFERER"] returns null/Nothing.... what else could I use to check for this?
thanks for any ideas..
P
|
|
|
|
|
How can i develop a product catalog that diplay a large picture of product and put the description with price under the picture? I use DataList, but the pictures don't appear. Is it true, if i use image handler, my data type for image must be in binary? My current data type for image now is varchar.
<asp:DataList
id="dlstImages"
RepeatColumns="3"
runat="server">
<ItemTemplate>
<asp:Image ID="Image1"
ImageUrl='<%# Eval("Name", "~/UploadImages/{0}") %>'
style="width:200px"
Runat="server" />
<br />
<%# Eval("Name") %>
</ItemTemplate>
</asp:DataList>
|
|
|
|
|
Varchar will screw up the data, I would guess. You should definitely use binary fields.
However, what you are doing here appears to be linking to an image on the server, not the image in the database; this means that the image name would be in varchar. Is your intention to refer to a folder, or to display the image data directly?
Also, you might want to use <img> tags instead of <asp:Image> controls; most people would consider it better practice to use the simplest control possible unless there's a good reason not to.
|
|
|
|
|
I use datatype varchar for image (put image path) and display in gridview, this is fine. But when i use the same datatype and display in datalist, the image didn't appear, but the description and price for the product appear. If i use binary for image, then i need to upload the picture to DB, rite? and also use generic handler. what is the easier way to display image for product and the details from different product categories (it's like e-commerce application)?
|
|
|
|
|
Displaying binary data directly in ASP is a bit hairy. I'd stick with an <img tag; View Source in IE to see what the path is, and check the data list to see if it's formatting your HTML as text - there should be a property in there somewhere. Again, View Source will help you out. My instinct is that it's some kind of HTML formatting issue.
|
|
|
|
|
hi all
plz i'v 2 datagrid
i want work with 2 tables.
so i've team and shampionliugue
when i choose 1 team from 1 datagrid
in the second datagrid the shampionliugue will display in it.
plz how to do it????
|
|
|
|
|
cheikhanio wrote: shampionliugue
LOL.
You want to catch a click event on datagrid one, and then use a value selected from that row, to select the data to show in grid two.
ChampionshipLeague.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I have a Td, which Iam converting it to edit mode.And Iam giving a textarea by which User can type along with the Old string in td.
But the problem is the textarea is not getting fixed to the Td.
I have given overflow:auto even set width and height to 100%
however if I press enter button in textarea itz getting fixed to Td.
so I tried using "/r/n" which is next line still the problem persists..
Can any one tell me how to INSERT A ENTER to the end of a String in Javascript? or is there any other solutions
Thanks in Advance
|
|
|
|
|
Hello all,
i want to now how i can have some thing be similar to bulleted list that it filter my data be similar to dropdownlist.
for example i have this list of item for subject of book:
computer book
children book
i want when i click on one of them(for example computer) i navigate to another page that be have sub group of computer book subject that it filtered by it's id:
Software
Hardware
Network
that in this page exist a data list that when i click software,in datalist comes subject of book for example related to software.
i try do this, but i wasn't successful,i'm not sure what Control is suitable for this work too.
i used bulleted list and i try behave with it be similar to drop down list and data lists in 2 pages
please help me...
Thank you
Hoda
|
|
|
|
|
I would use a repeater to generate my bullet list, if you are doing it from a data source. Then I'd render links that post back to allow you to create the behaviour you're after
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi all of you;
i am developing asp.net webpage with ajax component.
i have one update panel. On the update panel i have dropdownlists,
radiobuttons, and Textboxes and one button.
i want to give a message if some of the parts are not filled.
but on button clicking page is refreshing and data which is inside of textbox is clearing.
Textboxes work with ajax cleander also.
Only textboxes values are clearing, the other parts is not clearing when the page is refreshing.
How can i solve this problem?
are there any one to help me.
|
|
|
|
|
Hi
i need to check the information on a web page and access information to text box on this web, by code.
how can i do that in c#?
thanks.
|
|
|
|
|
Is it your web page and you are writing the server side code? If so the server side code is the same as writing a C# application with forms:
string str = textBox1.text;
At university studying Software Engineering - if i say this line to girls i find they won't talk to me
Dan
|
|
|
|
|
Thanks Dan
Its a client side. i need to open the site as a regular internet user do, on screen.
check the information on screen and access to txtbox with no human intervention.
how to do that?
|
|
|
|
|
You can download the the web page using a httpWebRequest object (I think thats its name - its definitely close).
Parse the web page that is returned for the name of the textbox and then parse its value - that should do it.
At university studying Software Engineering - if i say this line to girls i find they won't talk to me
Dan
|
|
|
|
|
Hi there,
Ok.. not really too grate on the C# / Generics bit.. so feel free to laugh!
I have a simple idea.. a stupid implementation!
I am trying to create a generic method to cache something (i.e. string, hashtable, etc), and the a simple method to return that cached generic value without unboxing.
So I have something like:
(Create method)
public void add<T>(string ID, T itemAdd)
{
Cache.Insert(ID, itemAdd);
}
(Retrieve method)
public void ret<T>(string ID, T itemBack)
{
itemBack = Cache.Get(ID);
}
Okay, okay, I know that doesn't look right, and the only way I can get it to work is:
public void ret<T>(string ID, T itemBack)
{
itemBack = (T)Cache.Get(ID);
}
Obviously the way it works is by unboxing the cache item back rather than some "generics" magic.
As I said, I am not an expert, and I have been searching to find references to this albeit not
too successfully as I am probably asking the wrong question!
Any ideas, or laughs at my stupidity most welcome! </t></t></t>
|
|
|
|
|
More fun... actualy found that in an ASP.NET page, you can of course do the following with the Cache object:
Cache.Cast<T> which takes the content of the Cache and makes it available to whatever generic type you need.
Also, got around (albeit I'm guessing not necessarily a best practice) the Cache retrieval part within a class using HTTPruntime and the following:
public T getCache<T>(string CacheID)
{
if (CacheID != null)
{
return (T)Cache.Get(CacheID);
}
else
{
return default(T);
}
}
Not pretty.. but works... the only thing now is finding out WHY and if I SHOULD !!!
|
|
|
|
|
|
I installed .Net framework 3.0 but not getting the templates of WCF WPF etc. What extra configuration is to be done for that.
Bijay Bhaskar Deo
Thanks & Regard
|
|
|
|
|
This is not the right forum for this question. However, I'm in a good mood so I'll answer it - you need to download the VS2005 extensions here[^] assuming you are using VS2005.
|
|
|
|
|
hi all, i have made asp.net application in C#. suppose my site adress is
"abc.com"
I have pages related to admin and user but there are no folder, there
are internal page links on my site, like login link, when login link is
clicked within site user is redirected to "abc.com/login.aspx" and this
appear as it is on Ie browser bar, what i want is it should
"abc.com/admin/login.aspx" or "abc.com" (change browser bar adress and use
httpcontext.rewritepath() method),
There more similar situations like this but that is simplest, i know
other solution of that instead of login.aspx, link href should be
"/admin/login.aspx" but i dont want this solution and use
httpcontext.Rewritepath() method.
what i am intrested is href should be "abc.com/login.aspx" but afer
clicking on link and on post back Browser bar should display
"abc.com/admin/login.aspx" or only "abc.com", i want change values from
browser bar.
i hope you understand this problem i am doing this asp.net C#.
Regards.
Tasleem Arif
|
|
|
|