how to insert the current url of the page in the databaseBest way to get identity of inserted row?How to return only the Date from a SQL Server DateTime datatypeHow to check if a column exists in a SQL Server table?How do I get list of all tables in a database using TSQL?How to concatenate text from multiple rows into a single text string in SQL server?Inserting multiple rows in a single SQL query?Insert results of a stored procedure into a temporary tableHow do I UPDATE from a SELECT in SQL Server?How to get current page URL in MVC 3Get size of all tables in database

Was the 2019 Lion King film made through motion capture?

Am I overreacting to my team leader's unethical requests?

How to mark beverage cans in a cooler for a blind person?

Dereferencing a pointer in a 'for' loop initializer creates a segmentation fault

How can I tell if a flight itinerary is fake?

Team goes to lunch frequently, I do intermittent fasting but still want to socialize

Dropdowns & Chevrons for Right to Left languages

Why are Gatwick's runways too close together?

Why should we care about syntactic proofs if we can show semantically that statements are true?

Can a spacecraft use an accelerometer to determine its orientation?

Visa National - No Exit Stamp From France on Return to the UK

How would I as a DM create a smart phone-like spell/device my players could use?

Why does Intel's Haswell chip allow FP multiplication to be twice as fast as addition?

In reversi, can you overwrite two chips in one move?

A stranger from Norway wants to have money delivered to me

Best way to divide CPU along all sql instances on 1 server

Look mom! I made my own (Base 10) numeral system!

Drawing complex inscribed and circumscribed polygons in TikZ

Ex-contractor published company source code and secrets online

How should an administrative assistant reply to student addressing them as "Professor" or "Doctor"?

What are these two charactes marked red

How do we avoid CI-driven development...?

Why aren’t emergency services using callsigns?

How quickly could a country build a tall concrete wall around a city?



how to insert the current url of the page in the database


Best way to get identity of inserted row?How to return only the Date from a SQL Server DateTime datatypeHow to check if a column exists in a SQL Server table?How do I get list of all tables in a database using TSQL?How to concatenate text from multiple rows into a single text string in SQL server?Inserting multiple rows in a single SQL query?Insert results of a stored procedure into a temporary tableHow do I UPDATE from a SELECT in SQL Server?How to get current page URL in MVC 3Get size of all tables in database






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-3















if (ModelState.IsValid)


ip.patientname = fc["patientname"];
ip.patientmail = fc["patientmail"];
ip.patientcountry = fc["patientcountry"];
ip.patientquery = fc["patientquery"];
ip.SecurityCode = fc["SecurityCode"];

string url = Request.Url.AbsoluteUri;




dblayer.Add_data_pharma(ip);
TempData["msg"] = "Inserted";


else

TempData["msg"] = "Not Inserted";



ModelState.Clear();
return Redirect(Request.UrlReferrer.PathAndQuery);
}


string url = Request.Url.AbsoluteUri;



I want to know how to insert url name in the database using Request.Url.AbsoluteUri or any method.



public void Add_data_pharma(insert_askpharma_mar212019 ip)

SqlCommand com = new SqlCommand("insert_askpharma", con);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@pharmaid", ip.pharmaid);
com.Parameters.AddWithValue("@patientname", ip.patientname);
com.Parameters.AddWithValue("@patientmail", ip.patientmail);
com.Parameters.AddWithValue("@patientcountry", ip.patientcountry);
com.Parameters.AddWithValue("@patientquery", ip.patientquery);
com.Parameters.AddWithValue("@SecurityCode", ip.SecurityCode);
com.Parameters.AddWithValue("@urlname", string.Empty);
com.Parameters.AddWithValue("@ipaddress", string.Empty);
con.Open();
com.ExecuteNonQuery();
con.Close();



I want to insewrt the current page url in the database using mvc



<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>

</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<h3 style="color:#669900">Personal Information</h3>
@using (Html.BeginForm("AskOurPharmacist", "Basic", FormMethod.Post, new @id = "kycFormTab5" ))

<div class="form-group">
<label for="email">Name*</label>
<input type="text" class="form-control" id="patientname" name="patientname">
</div>
<div class="form-group">
<label for="pwd">Phone*</label>
<input type="text" class="form-control" id="" name="">
</div>
<div class="form-group">
<label for="email">Email*</label>
<input type="email" class="form-control" id="patientmail" name="patientmail">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientcountry" name="patientcountry">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientquery" name="patientquery">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="SecurityCode" name="SecurityCode">
</div>
<div class="form-group">
<input type="hidden" class="form-control" id="urlname" name="urlname">
</div>
<button type="submit" class="btn btn-success">Email me When in Stock</button>

</div>
<div class="col-sm-6">
<div class="rbox">
<h4 class=" text-center"><strong>Why shop with Us?</strong></h4>
<ul class="list-unstyled">
<li><i class="fa fa-heart">&nbsp;</i>Trusted for Quality and Price</li>
<li><i class="fa fa-heart">&nbsp;</i>80-90% Savings - Lowest Prices</li>
<li><i class="fa fa-heart">&nbsp;</i>Free Shipping WorldWide*</li>
<li><i class="fa fa-heart">&nbsp;</i>360° Round View of Products</li>
<li><i class="fa fa-heart">&nbsp;</i>No Hidden Cost</li>
<li><i class="fa fa-heart">&nbsp;</i>Saving Rewards, Referral Discounts</li>
<li><i class="fa fa-heart">&nbsp;</i>Quality-Assured Medications</li>
<li class="text-right">*T&C Apply</li>
</ul>
</div>
</div>
</div>
</div>


This is my view ,in one mehod i have inserted two forms in this form only i want to insert the url in the database all are in the same table



this is my database










share|improve this question


























  • how to pass the string url = Request.Url.AbsoluteUri; in the datbase

    – Kavya Senthil
    Mar 27 at 7:43











  • Request.Url.AbsoluteUri is string , save it in a new column what is your problem exactly ?

    – Mohammad Alghanem
    Mar 27 at 7:54











  • I want to insert the current page url in the database when the form submitted please help me ,my code is above and databse is there

    – Kavya Senthil
    Mar 27 at 7:57












  • ip.URL= Request.Url.AbsoluteUri; ?????????

    – Mohammad Alghanem
    Mar 27 at 8:07











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32

















-3















if (ModelState.IsValid)


ip.patientname = fc["patientname"];
ip.patientmail = fc["patientmail"];
ip.patientcountry = fc["patientcountry"];
ip.patientquery = fc["patientquery"];
ip.SecurityCode = fc["SecurityCode"];

string url = Request.Url.AbsoluteUri;




dblayer.Add_data_pharma(ip);
TempData["msg"] = "Inserted";


else

TempData["msg"] = "Not Inserted";



ModelState.Clear();
return Redirect(Request.UrlReferrer.PathAndQuery);
}


string url = Request.Url.AbsoluteUri;



I want to know how to insert url name in the database using Request.Url.AbsoluteUri or any method.



public void Add_data_pharma(insert_askpharma_mar212019 ip)

SqlCommand com = new SqlCommand("insert_askpharma", con);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@pharmaid", ip.pharmaid);
com.Parameters.AddWithValue("@patientname", ip.patientname);
com.Parameters.AddWithValue("@patientmail", ip.patientmail);
com.Parameters.AddWithValue("@patientcountry", ip.patientcountry);
com.Parameters.AddWithValue("@patientquery", ip.patientquery);
com.Parameters.AddWithValue("@SecurityCode", ip.SecurityCode);
com.Parameters.AddWithValue("@urlname", string.Empty);
com.Parameters.AddWithValue("@ipaddress", string.Empty);
con.Open();
com.ExecuteNonQuery();
con.Close();



I want to insewrt the current page url in the database using mvc



<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>

</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<h3 style="color:#669900">Personal Information</h3>
@using (Html.BeginForm("AskOurPharmacist", "Basic", FormMethod.Post, new @id = "kycFormTab5" ))

<div class="form-group">
<label for="email">Name*</label>
<input type="text" class="form-control" id="patientname" name="patientname">
</div>
<div class="form-group">
<label for="pwd">Phone*</label>
<input type="text" class="form-control" id="" name="">
</div>
<div class="form-group">
<label for="email">Email*</label>
<input type="email" class="form-control" id="patientmail" name="patientmail">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientcountry" name="patientcountry">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientquery" name="patientquery">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="SecurityCode" name="SecurityCode">
</div>
<div class="form-group">
<input type="hidden" class="form-control" id="urlname" name="urlname">
</div>
<button type="submit" class="btn btn-success">Email me When in Stock</button>

</div>
<div class="col-sm-6">
<div class="rbox">
<h4 class=" text-center"><strong>Why shop with Us?</strong></h4>
<ul class="list-unstyled">
<li><i class="fa fa-heart">&nbsp;</i>Trusted for Quality and Price</li>
<li><i class="fa fa-heart">&nbsp;</i>80-90% Savings - Lowest Prices</li>
<li><i class="fa fa-heart">&nbsp;</i>Free Shipping WorldWide*</li>
<li><i class="fa fa-heart">&nbsp;</i>360° Round View of Products</li>
<li><i class="fa fa-heart">&nbsp;</i>No Hidden Cost</li>
<li><i class="fa fa-heart">&nbsp;</i>Saving Rewards, Referral Discounts</li>
<li><i class="fa fa-heart">&nbsp;</i>Quality-Assured Medications</li>
<li class="text-right">*T&C Apply</li>
</ul>
</div>
</div>
</div>
</div>


This is my view ,in one mehod i have inserted two forms in this form only i want to insert the url in the database all are in the same table



this is my database










share|improve this question


























  • how to pass the string url = Request.Url.AbsoluteUri; in the datbase

    – Kavya Senthil
    Mar 27 at 7:43











  • Request.Url.AbsoluteUri is string , save it in a new column what is your problem exactly ?

    – Mohammad Alghanem
    Mar 27 at 7:54











  • I want to insert the current page url in the database when the form submitted please help me ,my code is above and databse is there

    – Kavya Senthil
    Mar 27 at 7:57












  • ip.URL= Request.Url.AbsoluteUri; ?????????

    – Mohammad Alghanem
    Mar 27 at 8:07











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32













-3












-3








-3








if (ModelState.IsValid)


ip.patientname = fc["patientname"];
ip.patientmail = fc["patientmail"];
ip.patientcountry = fc["patientcountry"];
ip.patientquery = fc["patientquery"];
ip.SecurityCode = fc["SecurityCode"];

string url = Request.Url.AbsoluteUri;




dblayer.Add_data_pharma(ip);
TempData["msg"] = "Inserted";


else

TempData["msg"] = "Not Inserted";



ModelState.Clear();
return Redirect(Request.UrlReferrer.PathAndQuery);
}


string url = Request.Url.AbsoluteUri;



I want to know how to insert url name in the database using Request.Url.AbsoluteUri or any method.



public void Add_data_pharma(insert_askpharma_mar212019 ip)

SqlCommand com = new SqlCommand("insert_askpharma", con);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@pharmaid", ip.pharmaid);
com.Parameters.AddWithValue("@patientname", ip.patientname);
com.Parameters.AddWithValue("@patientmail", ip.patientmail);
com.Parameters.AddWithValue("@patientcountry", ip.patientcountry);
com.Parameters.AddWithValue("@patientquery", ip.patientquery);
com.Parameters.AddWithValue("@SecurityCode", ip.SecurityCode);
com.Parameters.AddWithValue("@urlname", string.Empty);
com.Parameters.AddWithValue("@ipaddress", string.Empty);
con.Open();
com.ExecuteNonQuery();
con.Close();



I want to insewrt the current page url in the database using mvc



<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>

</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<h3 style="color:#669900">Personal Information</h3>
@using (Html.BeginForm("AskOurPharmacist", "Basic", FormMethod.Post, new @id = "kycFormTab5" ))

<div class="form-group">
<label for="email">Name*</label>
<input type="text" class="form-control" id="patientname" name="patientname">
</div>
<div class="form-group">
<label for="pwd">Phone*</label>
<input type="text" class="form-control" id="" name="">
</div>
<div class="form-group">
<label for="email">Email*</label>
<input type="email" class="form-control" id="patientmail" name="patientmail">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientcountry" name="patientcountry">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientquery" name="patientquery">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="SecurityCode" name="SecurityCode">
</div>
<div class="form-group">
<input type="hidden" class="form-control" id="urlname" name="urlname">
</div>
<button type="submit" class="btn btn-success">Email me When in Stock</button>

</div>
<div class="col-sm-6">
<div class="rbox">
<h4 class=" text-center"><strong>Why shop with Us?</strong></h4>
<ul class="list-unstyled">
<li><i class="fa fa-heart">&nbsp;</i>Trusted for Quality and Price</li>
<li><i class="fa fa-heart">&nbsp;</i>80-90% Savings - Lowest Prices</li>
<li><i class="fa fa-heart">&nbsp;</i>Free Shipping WorldWide*</li>
<li><i class="fa fa-heart">&nbsp;</i>360° Round View of Products</li>
<li><i class="fa fa-heart">&nbsp;</i>No Hidden Cost</li>
<li><i class="fa fa-heart">&nbsp;</i>Saving Rewards, Referral Discounts</li>
<li><i class="fa fa-heart">&nbsp;</i>Quality-Assured Medications</li>
<li class="text-right">*T&C Apply</li>
</ul>
</div>
</div>
</div>
</div>


This is my view ,in one mehod i have inserted two forms in this form only i want to insert the url in the database all are in the same table



this is my database










share|improve this question
















if (ModelState.IsValid)


ip.patientname = fc["patientname"];
ip.patientmail = fc["patientmail"];
ip.patientcountry = fc["patientcountry"];
ip.patientquery = fc["patientquery"];
ip.SecurityCode = fc["SecurityCode"];

string url = Request.Url.AbsoluteUri;




dblayer.Add_data_pharma(ip);
TempData["msg"] = "Inserted";


else

TempData["msg"] = "Not Inserted";



ModelState.Clear();
return Redirect(Request.UrlReferrer.PathAndQuery);
}


string url = Request.Url.AbsoluteUri;



I want to know how to insert url name in the database using Request.Url.AbsoluteUri or any method.



public void Add_data_pharma(insert_askpharma_mar212019 ip)

SqlCommand com = new SqlCommand("insert_askpharma", con);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@pharmaid", ip.pharmaid);
com.Parameters.AddWithValue("@patientname", ip.patientname);
com.Parameters.AddWithValue("@patientmail", ip.patientmail);
com.Parameters.AddWithValue("@patientcountry", ip.patientcountry);
com.Parameters.AddWithValue("@patientquery", ip.patientquery);
com.Parameters.AddWithValue("@SecurityCode", ip.SecurityCode);
com.Parameters.AddWithValue("@urlname", string.Empty);
com.Parameters.AddWithValue("@ipaddress", string.Empty);
con.Open();
com.ExecuteNonQuery();
con.Close();



I want to insewrt the current page url in the database using mvc



<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>

</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<h3 style="color:#669900">Personal Information</h3>
@using (Html.BeginForm("AskOurPharmacist", "Basic", FormMethod.Post, new @id = "kycFormTab5" ))

<div class="form-group">
<label for="email">Name*</label>
<input type="text" class="form-control" id="patientname" name="patientname">
</div>
<div class="form-group">
<label for="pwd">Phone*</label>
<input type="text" class="form-control" id="" name="">
</div>
<div class="form-group">
<label for="email">Email*</label>
<input type="email" class="form-control" id="patientmail" name="patientmail">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientcountry" name="patientcountry">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="patientquery" name="patientquery">
</div>
<div class="form-group">

<input type="hidden" class="form-control" id="SecurityCode" name="SecurityCode">
</div>
<div class="form-group">
<input type="hidden" class="form-control" id="urlname" name="urlname">
</div>
<button type="submit" class="btn btn-success">Email me When in Stock</button>

</div>
<div class="col-sm-6">
<div class="rbox">
<h4 class=" text-center"><strong>Why shop with Us?</strong></h4>
<ul class="list-unstyled">
<li><i class="fa fa-heart">&nbsp;</i>Trusted for Quality and Price</li>
<li><i class="fa fa-heart">&nbsp;</i>80-90% Savings - Lowest Prices</li>
<li><i class="fa fa-heart">&nbsp;</i>Free Shipping WorldWide*</li>
<li><i class="fa fa-heart">&nbsp;</i>360° Round View of Products</li>
<li><i class="fa fa-heart">&nbsp;</i>No Hidden Cost</li>
<li><i class="fa fa-heart">&nbsp;</i>Saving Rewards, Referral Discounts</li>
<li><i class="fa fa-heart">&nbsp;</i>Quality-Assured Medications</li>
<li class="text-right">*T&C Apply</li>
</ul>
</div>
</div>
</div>
</div>


This is my view ,in one mehod i have inserted two forms in this form only i want to insert the url in the database all are in the same table



this is my database







sql-server asp.net-mvc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 10:53









Mohammad Alghanem

4043 silver badges18 bronze badges




4043 silver badges18 bronze badges










asked Mar 27 at 7:39









Kavya SenthilKavya Senthil

14 bronze badges




14 bronze badges















  • how to pass the string url = Request.Url.AbsoluteUri; in the datbase

    – Kavya Senthil
    Mar 27 at 7:43











  • Request.Url.AbsoluteUri is string , save it in a new column what is your problem exactly ?

    – Mohammad Alghanem
    Mar 27 at 7:54











  • I want to insert the current page url in the database when the form submitted please help me ,my code is above and databse is there

    – Kavya Senthil
    Mar 27 at 7:57












  • ip.URL= Request.Url.AbsoluteUri; ?????????

    – Mohammad Alghanem
    Mar 27 at 8:07











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32

















  • how to pass the string url = Request.Url.AbsoluteUri; in the datbase

    – Kavya Senthil
    Mar 27 at 7:43











  • Request.Url.AbsoluteUri is string , save it in a new column what is your problem exactly ?

    – Mohammad Alghanem
    Mar 27 at 7:54











  • I want to insert the current page url in the database when the form submitted please help me ,my code is above and databse is there

    – Kavya Senthil
    Mar 27 at 7:57












  • ip.URL= Request.Url.AbsoluteUri; ?????????

    – Mohammad Alghanem
    Mar 27 at 8:07











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32
















how to pass the string url = Request.Url.AbsoluteUri; in the datbase

– Kavya Senthil
Mar 27 at 7:43





how to pass the string url = Request.Url.AbsoluteUri; in the datbase

– Kavya Senthil
Mar 27 at 7:43













Request.Url.AbsoluteUri is string , save it in a new column what is your problem exactly ?

– Mohammad Alghanem
Mar 27 at 7:54





Request.Url.AbsoluteUri is string , save it in a new column what is your problem exactly ?

– Mohammad Alghanem
Mar 27 at 7:54













I want to insert the current page url in the database when the form submitted please help me ,my code is above and databse is there

– Kavya Senthil
Mar 27 at 7:57






I want to insert the current page url in the database when the form submitted please help me ,my code is above and databse is there

– Kavya Senthil
Mar 27 at 7:57














ip.URL= Request.Url.AbsoluteUri; ?????????

– Mohammad Alghanem
Mar 27 at 8:07





ip.URL= Request.Url.AbsoluteUri; ?????????

– Mohammad Alghanem
Mar 27 at 8:07













it is not working

– Kavya Senthil
Mar 27 at 8:32





it is not working

– Kavya Senthil
Mar 27 at 8:32












1 Answer
1






active

oldest

votes


















0














you must have a column(if not add 1 with name url) in database let say url which also will be available(if not add a property with the name url) in Model class ip. You method dblayer.Add_data_pharma(ip) will do the rest.




ip.url = Request.Url.AbsoluteUri;







share|improve this answer

























  • it is not inserted in the db,i want to pass anything in view

    – Kavya Senthil
    Mar 27 at 7:53











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32











  • do you want to insert url in database? or just pass it on the view?

    – Nomi Ali
    Mar 27 at 8:34











  • i want to insert url in the database

    – Kavya Senthil
    Mar 27 at 8:50












  • you can use, viewbag/viewdata/tempdata: e.g: ViewBag.Url = Request.Url.AbsoluteUri; in view you can get value like: string s = View.Url;

    – Nomi Ali
    Mar 27 at 8:52










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372021%2fhow-to-insert-the-current-url-of-the-page-in-the-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














you must have a column(if not add 1 with name url) in database let say url which also will be available(if not add a property with the name url) in Model class ip. You method dblayer.Add_data_pharma(ip) will do the rest.




ip.url = Request.Url.AbsoluteUri;







share|improve this answer

























  • it is not inserted in the db,i want to pass anything in view

    – Kavya Senthil
    Mar 27 at 7:53











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32











  • do you want to insert url in database? or just pass it on the view?

    – Nomi Ali
    Mar 27 at 8:34











  • i want to insert url in the database

    – Kavya Senthil
    Mar 27 at 8:50












  • you can use, viewbag/viewdata/tempdata: e.g: ViewBag.Url = Request.Url.AbsoluteUri; in view you can get value like: string s = View.Url;

    – Nomi Ali
    Mar 27 at 8:52















0














you must have a column(if not add 1 with name url) in database let say url which also will be available(if not add a property with the name url) in Model class ip. You method dblayer.Add_data_pharma(ip) will do the rest.




ip.url = Request.Url.AbsoluteUri;







share|improve this answer

























  • it is not inserted in the db,i want to pass anything in view

    – Kavya Senthil
    Mar 27 at 7:53











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32











  • do you want to insert url in database? or just pass it on the view?

    – Nomi Ali
    Mar 27 at 8:34











  • i want to insert url in the database

    – Kavya Senthil
    Mar 27 at 8:50












  • you can use, viewbag/viewdata/tempdata: e.g: ViewBag.Url = Request.Url.AbsoluteUri; in view you can get value like: string s = View.Url;

    – Nomi Ali
    Mar 27 at 8:52













0












0








0







you must have a column(if not add 1 with name url) in database let say url which also will be available(if not add a property with the name url) in Model class ip. You method dblayer.Add_data_pharma(ip) will do the rest.




ip.url = Request.Url.AbsoluteUri;







share|improve this answer













you must have a column(if not add 1 with name url) in database let say url which also will be available(if not add a property with the name url) in Model class ip. You method dblayer.Add_data_pharma(ip) will do the rest.




ip.url = Request.Url.AbsoluteUri;








share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 27 at 7:49









Nomi AliNomi Ali

1,0153 gold badges21 silver badges41 bronze badges




1,0153 gold badges21 silver badges41 bronze badges















  • it is not inserted in the db,i want to pass anything in view

    – Kavya Senthil
    Mar 27 at 7:53











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32











  • do you want to insert url in database? or just pass it on the view?

    – Nomi Ali
    Mar 27 at 8:34











  • i want to insert url in the database

    – Kavya Senthil
    Mar 27 at 8:50












  • you can use, viewbag/viewdata/tempdata: e.g: ViewBag.Url = Request.Url.AbsoluteUri; in view you can get value like: string s = View.Url;

    – Nomi Ali
    Mar 27 at 8:52

















  • it is not inserted in the db,i want to pass anything in view

    – Kavya Senthil
    Mar 27 at 7:53











  • it is not working

    – Kavya Senthil
    Mar 27 at 8:32











  • do you want to insert url in database? or just pass it on the view?

    – Nomi Ali
    Mar 27 at 8:34











  • i want to insert url in the database

    – Kavya Senthil
    Mar 27 at 8:50












  • you can use, viewbag/viewdata/tempdata: e.g: ViewBag.Url = Request.Url.AbsoluteUri; in view you can get value like: string s = View.Url;

    – Nomi Ali
    Mar 27 at 8:52
















it is not inserted in the db,i want to pass anything in view

– Kavya Senthil
Mar 27 at 7:53





it is not inserted in the db,i want to pass anything in view

– Kavya Senthil
Mar 27 at 7:53













it is not working

– Kavya Senthil
Mar 27 at 8:32





it is not working

– Kavya Senthil
Mar 27 at 8:32













do you want to insert url in database? or just pass it on the view?

– Nomi Ali
Mar 27 at 8:34





do you want to insert url in database? or just pass it on the view?

– Nomi Ali
Mar 27 at 8:34













i want to insert url in the database

– Kavya Senthil
Mar 27 at 8:50






i want to insert url in the database

– Kavya Senthil
Mar 27 at 8:50














you can use, viewbag/viewdata/tempdata: e.g: ViewBag.Url = Request.Url.AbsoluteUri; in view you can get value like: string s = View.Url;

– Nomi Ali
Mar 27 at 8:52





you can use, viewbag/viewdata/tempdata: e.g: ViewBag.Url = Request.Url.AbsoluteUri; in view you can get value like: string s = View.Url;

– Nomi Ali
Mar 27 at 8:52






Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372021%2fhow-to-insert-the-current-url-of-the-page-in-the-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현