|
Sorry. I didn't quite mean it like that. I know the use of this kind of table and have used many times before. I was more trying to get what it was used for in this instance. Like What is the relationship? Perhaps an appointment. That's why I ask is there no other fields
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Why are you editing? With a table like that the relationship is binary. It exists or it doesn't. There is nothing to edit. All you should need is insert and delete. If patient 15 wants to change doctors from 2 to 1, you should just delete the 2,15 row and add a 1,15 row. Otherwise add a surrogate key. I would suggest adding a surrogate key anyway since there are probably other pieces of data you will want in the future like date. When did the patient start seeing that doctor? That would be good for reporting on things like how many new patients does the doctor get each month.
|
|
|
|
|
As said above your statement doesn't make sense, so please consider the following :
"update DoctorPatient set DoctorID=@NewDoctorID,PatientID=@NewPatientID where DoctorID=@OldDoctorID and PatientID=@OldPatientID"
Please consider other suggestions too before implementing this.
|
|
|
|
|
hi guys, thanks for advice and info, but i found a way how to do this. so if anyone have same problem try this solution:
<asp:SqlDataSource ID="sds" runat="server"
ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
SelectCommand="
select
DoctorID,
PatientID,
DoctorID as DocOldID,
PatientID as PatientOldID
from
DoctorPatient"
UpdateCommand="
update DoctorPatient set
DoctorID=@DoctorID,
PatientID=@PatientID
where
DoctorID=@DocOldID and
PatientID=@PatientOldID">
</asp:SqlDataSource>
<asp:DetailsView runat="server" ID="dv"
DataKeyNames="DocOldID,PatientOldID"
DataSourceID="sds" AllowPaging="true"
AutoGenerateRows="false"
AutoGenerateEditButton="true">
<Fields>
<asp:BoundField DataField="DoctorID" />
<asp:BoundField DataField="PatientID" />
</Fields>
</asp:DetailsView>
|
|
|
|
|
Hi ,
I need to add OnClick and OndblCick Attributes in RowDataBound event ,
OnClick for get first cell value and store it in Session and OndblCick for redirecting to newpage.aspx.I tried with
below code in RowDataBound, and i'm not using template fields for gridview directly bindig datasource(template fileds not require for me).
e.Row.Attributes["ondblclick"] = ClientScript.GetPostBackClientHyperlink(this.gv_commondataList, "Select$" + e.Row.RowIndex,true);
-----
single Click :
------------
i added one btn_Hidden control in Display none Div tag. This Button Click event firing properly but gv_commondataList_SelectedIndexChanged event not firing on row Double Click
e.Row.Attributes.Add("onclick", "document.getElementById('" + hd_ItemValue.ClientID + "').value=" + e.Row.RowIndex + ";document.getElementById('" + btn_Hidden.ClientID + "').click();");
Could you please suggest me better way to solve my problem.
Regards,
vishnu.
|
|
|
|
|
hi. you can solve problem using asp.net ajax - WebMethods. use this code:
void myGv_RowDataBound(object sender, GridViewRowEventArgs e)
{
string value = e.Row.Cells[0].Text;
e.Row.Attributes["onclick"] = "PageMethods.InitSession('"+value+"')";
e.Row.Attributes["ondblclick"] = "window.location='something.aspx'";
}
[System.Web.Services.WebMethod()]
public static void InitSession(string value)
{
Page page = (System.Web.HttpContext.Current.CurrentHandler as Page);
page.Session["Test"] = value;
}
and add this markup on your aspx
<asp:ScriptManager runat="server" ID="sm" EnablePageMethods="true" />
|
|
|
|
|
Hi,
I am new to asp.net.I am using ajaxtabcontainer and ajax tabpanel to generate 4 tabs in the aspx page.But here after the tabs some extra space is generated and that has to be removed.Actualy i have written a code for sitemap.So in between tabs and sitemap space should not be present.I have tried with valign="bottom" but it didnot help.Could you please help me in this regard.
I have pasted my aspx code below.
<pre><table cellpadding="0" cellspacing="0" border="0" >
<!-- Ajax tab container -->
<tr style="background-color: Transparent;" valign="bottom" >
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ajaxToolkit:TabContainer ID="tabcontainer" runat="server" BorderWidth="0" CssClass="ajaxtab">
<td width="50">
</td>
<td>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabAdmin" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnAdmin" runat="server" Height="100%" ImageUrl="/images/Tabs/admin_blue.jpg"
OnClick="ibtnAdmin_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabConfiguration" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnConfiguration" runat="server" Height="100%" ImageUrl="/images/Tabs/configuration_blue.jpg"
OnClick="ibtnConfiguration_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabReports" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnReports" runat="server" Height="100%" ImageUrl="/images/Tabs/report_blue.jpg"
OnClick="ibtnReports_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td>
</td>
<td valign="bottom">
<ajaxToolkit:TabPanel ID="tabSimulation" runat="server">
<HeaderTemplate>
<div>
<asp:ImageButton ID="ibtnSimulation" runat="server" Height="100%" ImageUrl="/images/Tabs/simulation_Blue.jpg"
OnClick="ibtnSimulation_Click" />
</div>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</td>
<td width="50">
</td>
<td>
</td>
<td>
</td>
</ajaxToolkit:TabContainer>
</tr>
</table>
</div>
</td>
</tr>
<tr valign="top">
<td align="center" colspan="2" valign="top">
<div id="divSiteMap">
<table class="SiteMapBars" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="right" valign="middle">
<table border="0" width="100%" cellpadding="6" cellspacing="0">
<tr>
<td align="left" valign="middle">
<asp:SiteMapPath ID="smpLinks" runat="server" Font-Names="Verdana" Font-Bold="true"
Font-Size="X-Small" PathSeparator=" >> ">
<PathSeparatorStyle Font-Bold="True" ForeColor="#990000" Font-Size="Smaller" />
<RootNodeStyle Font-Bold="True" ForeColor="#FF8000" />
<NodeStyle Font-Bold="True" ForeColor="#284E98" />
<RootNodeStyle Font-Bold="True" ForeColor="#FF8000" />
<CurrentNodeStyle ForeColor="#333333" />
</asp:SiteMapPath>
</td>
<td align="right">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr></pre>
|
|
|
|
|
Please use
Firefox => yslow + firebug
IE => pressing f12 and find element (ctrl+ b)
Chrome => right click + inspect element
to find out what exactly is the cause - after that it will be a matter of little CSS modification...
|
|
|
|
|
Thanks a lot for the reply.I found the solution by giving "ImageAlign=AbsBottom" in ImageButton.
|
|
|
|
|
Hi,
I have one more doubt.I got the solution for my previous problem with your help , but now I have one more issue.Inside each ajax tab panel I have written ImageButtons which redirects to corresponding aspx pages.Now here I want to change the imageurl of the ImageButton after once it is clicked to indicate that ajax tab is active by using Ativetabchanged event ofajax tabcontainer.Since I have Response.Redirect in my codebehind it is not going to that event only.I can't use content template here because I need respective home pages for all the modules and hence i must need Imagebuttons for Redirecting.So how to change the Imageurl of that ImageButton ? Please help me in this regard.
Aspx code
------------------------------
<ajaxToolkit:TabContainer ID="tabcontainer" runat="server" BorderWidth="0" CssClass="ajaxtab" OnActiveTabChanged="tabContainer_ActiveTabChanged">
<ajaxToolkit:TabPanel ID="tabAdmin" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnAdmin" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/admin_blue.jpg"
OnClick="ibtnAdmin_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'"/>
</HeaderTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabConfiguration" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnConfiguration" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/configuration_blue.jpg"
OnClick="ibtnConfiguration_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'" />
</HeaderTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabReports" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnReports" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/report_blue.jpg"
OnClick="ibtnReports_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'" />
</HeaderTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabSimulation" runat="server">
<HeaderTemplate>
<asp:ImageButton ID="ibtnSimulation" runat="server" ImageAlign="AbsBottom" ImageUrl="/images/Tabs/simulation_Blue.jpg"
OnClick="ibtnSimulation_Click" OnClientClick="this.src='/images/Tabs/simulation_Gray.jpg'" />
</HeaderTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
aspx.cs
-------------------
protected void tabContainer_ActiveTabChanged(object sender, EventArgs e)
{
if (IsPostBack)
{
switch (tabcontainer.ActiveTab.TabIndex)
{
case 0: ibtnAdmin.ImageUrl = "/images/Tabs/simulation_Gray.jpg";
break;
case 1: ibtnConfiguration.ImageUrl = "/images/Tabs/simulation_Gray.jpg";
break;
case 2: ibtnReports.ImageUrl = "/images/Tabs/simulation_Gray.jpg";
break;
case 3: ibtnSimulation.ImageUrl = "/images/Tabs/simulation_Gray.jpg"; ;
break;
}
}
}
|
|
|
|
|
|
Good Day All
i have 20 Textboxes i am not sure what did i touch by i normally dont play with VS Settings i dont understand. So those textbox are normally defined like this
<asp:TextBox ID="txtUnitLen20" onKeyUp="Jump()" runat="server"
TabIndex="19" AutoPostBack="True"></asp:TextBox>
SerialsText.Add(txtUnitLen1.Text);
but if the value that is entered is "1" , there i will get this as a Value hex like this
[0x00000001] = "1";
Please note that the Textbox gives me "1" but the List gives me those Numbers
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Thanks for moving this.
Can you tell us what SerialsText is. txtUnitLen1.Text will just be the string "1" so the problem probably lies with the SerialsText object.
|
|
|
|
|
Good Day Keith
SerialsText is a List<string> and yes the textbox will give "1" , but when i am adding the value to the List<string> the value changes. I have attached a link to a screenshot that shows the watch of the List
http://www.vbforums.com/attachment.php?attachmentid=81284&stc=1&d=1291022277[^]
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I know it's confusing, but that (0x00000001) is the way that quickwatch displays integers, so in that sense there is nothing wrong. It looks hex but it isn't.
Vuyiswa Maseko wrote:
SerialsText.Add(txtUnitLen1.Text);
but if the value that is entered is "1" , there i will get this as a Value hex like this
[0x00000001] = "1";
Here 0x00000001 is the index of the item in SerialsText not the value itself, so for example if you entered 2 into the same textbox, this will appear as:
[0x00000001] = "2";
Note one thing: the value is "2" (a string) rather than 2 (an integer). You might need validation on your input, and to cast the value to an integer, depending upon your requirements.
Hope this helped!
|
|
|
|
|
Hey,
I am facing a problem.
When i run "exec sp_databases",it returns only system databases.
|
|
|
|
|
First, this should be in the database forum as it has nothing at all to do with ASP.NET.
Second, does the user account you are running this query under have access to the databases you are expecting to see?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Oh!You are right.It should be in database section.
I am running it under administrator rights.
|
|
|
|
|
so... maybe i'm doing something wrong but i'm having no luck checking if the uploaded file length is greater than i want to allow before an exception is thrown and the site crashes
i thought "Request.ContentLength" would allow me to filter out stuff that s too big and give a friendly error message to the user but, as i said, the site crashes with an exception
i have looked but can find no way to handle this exception gracefully ... any ideas gratefully received
also, please don't tell me to make the max upload allowed bigger ... that doesn't really solve the problem
the files are only supposed to be less than 1mb or so
thanks
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
any more detail will help - please try handling on error event @ global.asax...
|
|
|
|
|
You can use the MaxRequestLength[^] in the web.config to limit uploads. It can be discussed how friendly it is to the user.
But one of the problems with the contentlength is that it's not always present.
"When did ignorance become a point of view" - Dilbert
|
|
|
|
|
How are you getting the file? Something like...
Request.Files[0];
If so you can try something like...
if(Request.Files[0] != null && Request.Files[0].InputStream.Length > 1048576)
{
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
thanks to you and the others for the feedback
i discovered the problem is the web server itself having an issue with the uploaded filesize and causing an exception before i even get chance to test and handle it
i had to allow larger uploads and screen for a maxsize before processing but still if a user tries to upload a file bigger than the max i allowed it will cause an exception
not very good design imho
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Your right, that doesn't sound such a good design. thou I guess there needs to be a way to prevent stupid file sizes by default in case people forget to check within program
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
I'm creating a dynamic table and checkboxes at Button_Click event.
The user need to choose some of them and after words press ather button,
my problem is at the post back, how i can show the same dynamic checkboxes with the checked ones.
I tyied to use ViewState, but it's duplicate me the table.
Please help.
10x
|
|
|
|