|
HI,
I Created link button dynamically. When I click the link button it ill display the corresponding details which i stored in database.
How to do that?
Thanks in advance
|
|
|
|
|
Muthunagai.A wrote: When I click the link button it ill display the corresponding details which i stored in database.
You need to attach click event for that link button.
|
|
|
|
|
The List of Question and answers are stored in Database. Questions are all in link button. When i click the Question then only the answer will display.
Final output like this
Q: 1234? ---> link button
A: answer
Can u give me any idea? or sample? how to do this?
|
|
|
|
|
Are you using Datagrid to show questions ? If yes you can make use button column . Make button type as link button , which will be rendered as HTML Link. Set command name property of button column.
When user clicks link button, ASP.NET will fire ItemCommand event. You need to check the command inside this event to ensure that it is coming from your link button. Now get question id from the grid bound columns and query to database with this id for getting relevant answers.
|
|
|
|
|
|
No, I'm not using the Datagrid. I'm using Panel to show the result.
Sorrry, now tell me? how to do that?
|
|
|
|
|
1 .Take datagrid.
2. Take LinkButton in ItemTemplate and bind it with Question field.
3 take DIV and apply style display:none property
3. Take Label Control in div tag and Bind it with Answer field
4. Now call javascript function on LinkButton to display or hide Answer field
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
The trick is, if you dynamically create any controls, they need to be created before page_load, so that their viewstate is restored, and you get their events and values back.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you. But I want to do it in a button click event.Is it possible?
I have to edit the question & answer and store it to the database.
Thanks in advance
|
|
|
|
|
It doesn't matter where you create it the first time, so long as it's recreated before page_load on postback.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is this true: I can have 1 App_Code folder per asp.net application and multiple applications per website.
So, therefore I can have multiple App_Code folders on my website? For exmple:
Application1
/apps/debug/app/App_Code
Application2
/apps/app/App_Code
Will this work?
/\ |_ E X E GG
|
|
|
|
|
So long as you set them up as seperate web applications, I believe so.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have created a ASP.net application. In which I have added js and html file. In js file, function written for runtime thumbnail image creation. That function is passed on html file. I want to show large image onclick the thumbnail image.
THANKS
|
|
|
|
|
Then your javascript should create a popup window or floating DIV which contains the full image, I guess.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
tulsulkar wrote: I want to show large image onclick the thumbnail image.
If you want to show large image in the same page or in popup then Christian Graus told appropriate solution. If you want it to display in other page like what wikipedia is doing, just link to large image file link. Browser will show full image there.
|
|
|
|
|
Hello All,
I am dynamically adding the columns and rows to the gridview control. It is getting populated correctly, my problem here is i am not getting the horizontal scroll bar within the gridview.
How to add horizontal scrol bar to the griedview control, so that it will not affect the other controls on the page.
Thanks in advance.
Bharath.S Ron
|
|
|
|
|
It seems Gridview won't support horizondal scrolling. You need to place gridview inside DIV element and apply styles for DIV to show scrollbar.
<DIV style="OVERFLOW: auto; WIDTH: YourWidth; HEIGHT: YourHeight">
If your gridview width exceeds specified width, it will show scrollbar. I Don't know cross browser compatibility of this method.
|
|
|
|
|
|
Hi all,
I m executing my project in ie6. some times i use to execute my project in ie7
Here my problem is:
i m getting images well and good when i run it on the ie6 (my images are stored in my project in one folder) and in ie7 i m not able to get the images on my aspx page even though if the images are there on my image folder.But some times the images will disply on ie7.
plz any one can help..
Regards,
dharani.
|
|
|
|
|
When designing website, follow only W3C standards. IE is having lot of proprietary methods and styles for rendering content. Have you tried your website in FireFox ? Ensure that you are using W3C recommended design standards instead of using IE stuff.
|
|
|
|
|
Hi!
Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page.
Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated.
Thanks,
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Affan Toor wrote: then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page
You are seeing the cached version of page by browser. You can disable caching for pages and that could solve your problem.
|
|
|
|
|
Basically, all your pages should derive from a base page which checks if the user is logged in, and, if not, redirects to the login page.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
try this:
on login page:
protected void Page_Load(object sender, EventArgs e)
{
.........
//if the user is valid
Session.Add("user", user);
.......
}
on other page
protected void Page_Load(object sender, EventArgs e)
{
.......
if (Session["user"]==null)
Response.Redirect("login.aspx");
........
}
on logout
Session.Remove("user");
I hope that will help you.
|
|
|
|
|
clear the session on log out
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|