|
I can not do that because I don't know exactly text for the first three items of the list until my web application runs.
Text is added to my listbox by the following way:
foreach (DataRow row in dt.Rows)
{
string Msg = string.Format("{0} : {1}", row["Id"], row["Name_"]);
lstHisttory.Items.Add(Msg);
}
|
|
|
|
|
Hi All,
I want to ask what is the best way to have the link to a file expire after a set time, so that the user gets sent a download link via email which they only have access to for say 24 hours.
Thanks
|
|
|
|
|
Yes... Do the logic in the database.
Say you want the user to download a file. Place a log in the server of the file and use GUID for its identification.
When you create the email pass the Guid as query string.Thus if your download is
http://www.yourserver.com/filedown.dat?tid=xxxx-xxx-xxx
Thus the tid will represent the actual Guid link. Now create an http handler for .dat extension(or whatever you like). Now when user navigates to the site, check if the GUID is valid and also validate the time between the link sent and the actual request time. Based on that you might show appropriate message.
Note: This is a logic which I thought might be a solution.There are lots of others too, and you can choose any of them which suits you. Tell me if you have already thought any.
|
|
|
|
|
Hi Abhishek,
Thank you for your reply.
I had thought to use a GUID and store the time, but hadn't thought to use a http handler. I'll look into that. I'm new to Asp.net and wanted to check the GUID / database was the right way to go as I had an idea it was, but I just wasn't sure.
All the best
|
|
|
|
|
Yes... Go on to create a handler. Yes.. GUID will point to a time for the current user. As I stated, GUID will represents the entire record on the download.
If you dont want to httphandler, you might also go on creating a page. So that the navurl looks like
http://yourserver.com/download.aspx?id=xxx-xxx-xxx
This is the same thing. You might use either way. Infact page is also a IHttpHandler .
Cheers.
|
|
|
|
|
|
Well we can stick a timestamp in the url and retrieve it and cross check against the current time. saving dataspace and processing time on server.
also if one wants could salt the time stamp and decrypt. I am in the process to implement it. Let me now
Amol Ambilwade
|
|
|
|
|
i have a search box, i want to make it dynamic. In that searchbox i will be searching for movie name, if i type a name it should autosearch from the database which has columns movieid, moviename. see example below
---------------------------------------
movie id movie name
---------------------------------------
1 Independence Day
2 Titanic
3 Mr Bean
4 The Independence
5 Bean in Atlanta
--------------------------------------------
if i search the keyword independence; i should get search suggestion 1st and 4th of the above table. If i search for Bean, the search suggestion should be 3rd and 5th.
This will work just like google search suggestions.
I am new to coding; and have no idea. I need this in classic asp or asp.net
can any plese help me out with this simple coding
Regards,
maddy
|
|
|
|
|
You should take a look on this link.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Why do you need to think too much for that.. ??
Why dont you use normal sql to fetch the result ?
Just use normal search query like
SELECT * FROM MOVIES WHERE MovieName LIKE '%' + ISNULL(@P_MOVNAME, '') + '%'
Just pass the parameter @P_MovieName as "Bean" or "Independance" and it will find exactly the matched elements. Also if you dont pass anything it will select all.
Now after getting the result, show it in grid or whatever control you want.
|
|
|
|
|
hi
i want to print a word docx , document on the click of button , stored in the document library.
of the sharepoint server..from the page of the web application..
i tried using com object , but it is not opening the word application., throwing an error
if any has done this thing before , please help me...
regard
vimal
vimal kumar
|
|
|
|
|
|
I can click on to a button via the following code
object loginButton = webBrowser1.Document.GetElementById("ctl00_WorkSpace_Login1_LoginButton").InvokeMember("click");
but if there is a link on a website an external website that i want to click.
Regards,
Muhammad Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
You don't have to click. Just extract the link and redirect browser to there.
And your question has nothing to do with ASP.NET.
Best wishes,
Navaneeth
|
|
|
|
|
Thx Navaneeth, for your time to answer.
The link actually performs the postback operation. I am confident this question is an ASP.NET one, Kindly re evaluate the requirement.
Regards,
Muhammad Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
Awaiting for your input !!!
"Mess with the Best, Die like the rest"
|
|
|
|
|
Hi Guys,
Iam new to ASP.Net where iam currently working with GridView Control... Iam reading set of values from Database and below statements contains all the records iam sure abt it.
SqlConnection con = new SqlConnection(DB.ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("Select * from FB Employees where Empid=101 ",con);
SqlDataReader reader = cmd.ExecuteReader();
Now how to assign these values to GridView so that i can veiw in table format. here is the code iam using unable to bind values to Grid Control.
Plz help me regarding this...
GridView1.DataSource = reader;
GridView1.DataBind();
|
|
|
|
|
Pardhu2 wrote: nable to bind values to Grid Control.
What do you mean by that? Getting any errors? Are you closing the connection before assigning to GridView ? Reader requires connection to be active. Also it is good to wrap the connection, command and reader in using block. It ensures resources are released properly.
using(SqlConnection con = new SqlConnection(DB.ConnectionString))
using(SqlCommand cmd = new SqlCommand("Select * from FB Employees where Empid=101 ",con)) {
con.Open();
using(SqlDataReader reader = cmd.ExecuteReader()){
GridView1.DataSource = reader;
GridView1.DataBind();
}
} The above code is likely to work.
Best wishes,
Navaneeth
|
|
|
|
|
Hi All,
in aspx u need to following thing also.
<asp:boundfield headertext="User Id" visible="true" datafield="login_id">
this will bind corrosponding column to the grid
Thanks and regards,
Amit Patel
|
|
|
|
|
Give this a try.
SqlConnection con = new SqlConnection(DB.ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("Select * from FB Employees where Empid=101 ",con);
DataTable table = new DataTable();
table.load(cmd.ExecuteReader(),loadoption.upsert);
GridView1.DataSource = table;
GridView1.DataBind();
April
Comm100 - Leading Live Chat Software Provider
|
|
|
|
|
Hi,
you should create a data table with the column you want to show in your webpage.
DataTable dt = new DataTable("test");
dt.Columns.Add(new DataColumn("id", typeof(int)));//creat Columns
dt.Columns.Add(new DataColumn("name", typeof(string)));
dt.Columns.Add(new DataColumn("timer", typeof(DateTime)));
DataRow dr = dt.NewRow();//creat row
dr["id"] = reader[0].id;
dr["name"] = reader[0].name;
dr["timer"] = reader[0].timer;
...
dt.Rows.Add(dr);
Gridview1.datasource = test;
Gridview1.databind();
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:49pm.
|
|
|
|
|
Hi all
Iam stuck on the below task
I have Gridview inside gridview in outer gridview i binded the categores which are almost to six and on ROw Data bount event of Outer Gridview iam binding the inner gridview with items Names related to category by passing the category Id.
like
Category People
-- People one
-- People two
-- People three
Category Student
-- Student one
-- Studnet two
Now how i validate that if i checked the category People checkbox chekced then its related items will be unchecked how i make independat to each category and its items
Hope i will hear good comments
Share me the ideas how i approach this
Best Regards
Rameez
|
|
|
|
|
Why you have asked the same question again and Again ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Iam really sorry for doubling of the post i dont know how i post the double enteries sorry for that
iam getting applogize for it.
Thanks for the response
Regards
|
|
|
|
|
Hi all
Iam stuck on the below task
I have Gridview inside gridview in outer gridview i binded the categores which are almost to six and on ROw Data bount event of Outer Gridview iam binding the inner gridview with items Names related to category by passing the category Id.
like
Category People
-- People one
-- People two
-- People three
Category Student
-- Student one
-- Studnet two
Now how i validate that if i checked the category People checkbox chekced then its related items will be unchecked how i make independat to each category and its items
Hope i will hear good comments
Share me the ideas how i approach this
Best Regards
Rameez
|
|
|
|