|
|
Hello, im trying to build a gallery using C#.
Ii've made a Listview showing photos from database as thumbnails in a "kind of a film strip", including a pager.
What i need is that when i click on a thumbnail inside the ListView, to show the large photo in a image control outside the listview. this should work using the selectedIndexChanged event, i have no idea what to do in there, i will appreciate any help since i searched a lot online and didnt find anything helpful.
thank you,
Basil
|
|
|
|
|
Hi Farraj,
As far as i know,
you can use CSS[^] to get this functionality.
There is some example and tutorial on Google[^].
if ur intention is only want to display what u selected.
u can do that easily with CSS without post back.
give all image control from list view to same CssClass name.
then from css style sheet. change the image of outside frame.
you can get a lot of jQuery[^] example for this..
Hope it works!
|
|
|
|
|
Hi,
I wanted to have link button with name from the function as its value but couldn't figure it out how to do this. right now I am having the code like this but it doesn't work.
<asp:TemplateField HeaderText = "Name" >
<ItemTemplate>
<asp:LinkButton ID="btnViewDetails" runat="server" Text="<%# GetName(DataBinder.Eval(Container.DataItem, "First").ToString(), DataBinder.Eval(Container.DataItem, "Last").ToString())%>" OnClick="BtnViewDetails_Click" />
</ItemTemplate>
</asp:TemplateField>
Error is:
The server tag is not well formed.
I need to have link button text field from some functions. Is there any way to get this? any Ideas??
suchita
modified on Tuesday, March 15, 2011 10:23 AM
|
|
|
|
|
Hi,
Try this
<asp:TemplateField HeaderText = "Name" >
<ItemTemplate>
<asp:LinkButton ID="btnViewDetails" runat="server" Text='<%# GetName(Eval("First").ToString(), Eval("Last").ToString())%>' OnClick="BtnViewDetails_Click" />
</ItemTemplate>
</asp:TemplateField>
"The server tag is not well formed." error will be solved.
|
|
|
|
|
thanks.. I already solved this...
suchita
|
|
|
|
|
Hi,
In IE 8 session is shared between ie windows even when I open a new IE instance. This is going to create big issue with my application as I want diffrent instances of IE to have diffrent credentials.
Anyone faced this issue so far?
Any idea how to fix it via ASP codes?
|
|
|
|
|
This is a known [issue]. There are benefits and headaches for the session sharing. Let us see one of the benefits. Say your users have to login in order to access your application. Now a user wants to open one of your links in separate tab. If the session is not shared then they have to login in in order to access it, Right? So, sharing the session is not bad in this scenario.
On the other hand, you may have a valid reason for not sharing session. First try a simpler method. In IE click on the File Menu and select Open With New Session. If this is going to solve your problem, then instruct your users to use that technique. If that won't work for you, there first you need to understand this is happening at the client Browser side, so your control becomes very limited. Using Session or Cookie won't help as it will be shared. How about setting a hidden field with some value. Say in the beginning you start it off with a known value, may be a guid then you save it into dictionary or map . Then you can check if it exists and you know whether this is new or already visited page.
|
|
|
|
|
Thanks for you reply Yusuf. But I'm having this problem with IE6 as well.
My client does not want session sharing
|
|
|
|
|
guys, i have made a control with a modalpopupextender and several updatepanels.
on OpenDialog method i call
document.getElementById('<%= SomeLinkButtonWithinThePopupControl.ClientID %>');
and this calls __doPostBack('<%= SomeLinkButtonWithinThePopupControl.UniqueID %>','');
but this doesn't call the server to update the panels
i have this control on several pages and it worked properly
Help people,so poeple can help you.
|
|
|
|
|
Hi,
I have one button inside the itemtemplate under grid view.
<asp:TemplateField HeaderText = "Test">
<ItemTemplate>
<asp:Button ID="btnTest" runat="server" Text="select"/>
</ItemTemplate>
</asp:TemplateField>
Now I want that button click in code behind. How do i get that ?
suchita
|
|
|
|
|
1. Do you have a code behind file associated with the page? (I assume so.)
2. Add an onClick handler, and associate it with the button.
<asp:Button ID="btnTest" runat="server" Text="select" onClick="doSomething" />
protected void doSomething_Click(object sender, EventArgs e)
{
...
}
|
|
|
|
|
I'm looking for a way to have context sentitive help appear on my website when the user rolls over something. Much like a tool tip but I want more control over it.
Can anybody point me to some code that will do this and look reasonable?
TIA - Jeff.
|
|
|
|
|
jbradshaw wrote: look reasonable
That is a very broad definition.
You can always use a mouseover event to initial some JavaScript to perhaps display a div. Making it "look reasonable" is up to you with CSS.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Good Answer, Matty.
100
Help people,so poeple can help you.
|
|
|
|
|
Hi,
I have a gridview showing list of data . When I select one of the row in the gridview, I would like to get panal (say Panel1) to be popup. I used the Ajax ModalPopupExtender but I don't know what should be the value in TargetControlID ?
Please help.
suchita
|
|
|
|
|
Sir, set the TargetControlID to a hidden linkbutton id and in the gridview use javascript to open the popup
<a href="javascript:;" onclick="OpenDialog();" >Click me</a>
<script type="text/javascript" >
function OpenDialog() {
$find('<%= extender.ClientID %>').show();
}
</script>
100
Help people,so poeple can help you.
|
|
|
|
|
Place one button with visiblility off. And give that button Id as target Control ID.
|
|
|
|
|
Hi ,
i can not access to Gridview/ Ajax with Master Page.
When I place the Master page into Default.aspx and Try to bind to Gidview this give me error.
|
|
|
|
|
Honeyboy_20 wrote: i can not access to Gridview/ Ajax with Master Page.
Honeyboy_20 wrote: Try to bind to Gidview this give me error.
What error? There should not be any issue/error if your use or leave Master page. Maaster page is just a usercontrol and would not affect the binding of Grid.
|
|
|
|
|
I have 3 Pages
Default.aspx take from master page , till this point no problem.
but problem occur when I open pop up page to add course , the event of button not appear so i can not bind data to updated in Gridview.
|
|
|
|
|
Sir, if you are trying to access a control in master page from a content page using it, then use
Master.FindCntrol("ControlID") .
100
Help people,so poeple can help you.
|
|
|
|
|
Using EF Code First, I have implemented a dropdownlist on a create method everything works fine
however duplicate records are posted as the method is called twice.
Any idea what I have not implemented correcty.
Model(s)
public class Country
{
public int CountryId { get; set; }
public string Name { get; set; }
}
public class State
{
public int StateId { get; set; }
[Required(ErrorMessage = " Name is required")]
public string Name { get; set; }
[Required(ErrorMessage = " Code is required")]
public string Code { get; set; }
public virtual Country Country { get; set; }
[Required(ErrorMessage = " The Country is required")]
public int CountryId { get; set; }
}
Controller (partial)
[HttpPost]
public ActionResult Create(State newState)
{
ViewData["Countries"] = db.Countries.ToList();
try
{
// TODO: Add insert logic here
db.States.Add(newState);
db.SaveChanges();
return RedirectToAction("Index");
}
catch
{
return View(newState);
}
}
View (Partial)
<div class="editor-label">
@Html.LabelFor(model => model.CountryId)
</div>
<div class="editor-field">
@Html.DropDownListFor(model => model.CountryId, new SelectList(ViewBag.Countries, "CountryId", "Name"))
@Html.ValidationMessageFor(model => model.CountryId)
</div>
Regards
dotman1
|
|
|
|
|
1. Use PRE tags to format the code part. It makes the question readable.
2. Did you try to use VS Debugger and see how the execution is happening?
Based on what you have posted, it looks ok.
|
|
|
|
|
Thanks for the input.
Yes I did step through using VS debugger the create method is called and process the steps through to and including the call to db.SaveChanges(); return RedirectToAction("Index"); is not reached and the create method is called processing the second post this time after the call to db.SaveChanges(); return RedirectToAction("Index"); is returned. This is result is random in other instances the process flow is as expected but once again the create method is called twice.
dotman1
|
|
|
|